Project

General

Profile

Actions

Bug #1673

closed

Overflow in culture victory calculation

Added by Dean Brown about 2 months ago. Updated 5 days ago.

Status:
Closed
Priority:
Normal
Category:
Server
Target version:
Start date:
09/05/2025
Due date:
% Done:

0%

Estimated time:

Description

    if (best != NULL && best_value >= game.info.culture_vic_points
        && best_value > second_value * (100 + game.info.culture_vic_lead) / 100) {

If second_value > 7158277, the first multiplication exceeds 2**31 and overflows.

The back story - I made the history_interest_pml value too big in my custom ruleset, forgetting about what happens with compound interest. Culture values this big would never happen with supplied rulesets, but this should still get fixed.


Files

1673.patch (817 Bytes) 1673.patch Dean Brown, 09/05/2025 04:27 AM
1673Main.patch (821 Bytes) 1673Main.patch Dean Brown, 09/30/2025 05:58 AM
Actions

Also available in: Atom PDF