Port overflow fixes for daily interest and dividends; pay Modern dividends per manager

Daily interest and share dividends are computed in 64 bits before the
division (ported from OpenBMH 1.0.3). In Modern each manager now receives
the dividend of his own shares instead of the original's lost booking.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-13 23:47:09 +01:00
1 parent f0979455d1
commit 9e92d07b03
10 files changed
+59 -62

No files matched your search

+2 -2
View File
@@ -669,8 +669,8 @@ void shares_and_loans(GameState& g) {
// for the manager after the last one)
int32_t dividend = 0;
for (int m = 0; m < managers; m++)
dividend = int32_t(mem.u16(::bmh::layout::Advertising_OriginalShareAdjustment_RuntimeField + uint32_t(m) * 2 + uint32_t(k) * 0x1c) *
((price * uint32_t(kShareFactor[k])) / 10000));
dividend = int32_t(uint32_t(mem.u16(::bmh::layout::Advertising_OriginalShareAdjustment_RuntimeField + uint32_t(m) * 2 + uint32_t(k) * 0x1c) *
((uint64_t(price) * uint32_t(kShareFactor[k])) / 10000)));
book_money(g, managers, -dividend, true);
add32(r, size_t(managers) * kRecord + 0x870, dividend);
}