Project

General

Profile

Actions

Bug #1673

open

Overflow in culture victory calculation

Added by Dean Brown 11 days ago. Updated 11 days ago.

Status:
New
Priority:
Normal
Assignee:
-
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
Actions #1

Updated by Dean Brown 11 days ago

Actions #2

Updated by Marko Lindqvist 11 days ago

  • Category changed from General to Server
  • Target version set to 3.1.6

Patch does not apply to main branch.

Actions

Also available in: Atom PDF