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:
1 parent
f0979455d1
commit
9e92d07b03
10 files changed
+59
-62
No files matched your search
+1
-1
@@ -215,7 +215,7 @@ void manager_offers(GameState& g, int manager, WatcomRandom& rand, MinuteReport&
|
||||
if (kind == 14) {
|
||||
for (int k = 0; k < 6; k++) {
|
||||
const uint32_t held = g.memory.u16(::bmh::layout::Advertising_OriginalShareAdjustment_RuntimeField + uint32_t(manager) * 2 + uint32_t(k) * 0x1c);
|
||||
const uint32_t value = uint32_t(g.memory.u32(::bmh::layout::FundBlock + uint32_t(k) * 0x1c) * uint32_t(kShareFactor[k])) / 10000;
|
||||
const uint32_t value = uint32_t((uint64_t(g.memory.u32(::bmh::layout::FundBlock + uint32_t(k) * 0x1c)) * uint32_t(kShareFactor[k])) / 10000);
|
||||
sum += int(uint32_t(rand.range(10, 20)) * (held * value));
|
||||
}
|
||||
if (sum == 0) continue;
|
||||
|
||||
Reference in new issue
Block a user