Project

General

Profile

Actions

Bug #1673

closed

Overflow in culture victory calculation

Added by Dean Brown about 1 month 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 #1

Updated by Dean Brown about 1 month ago

Actions #2

Updated by Marko Lindqvist about 1 month ago

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

Patch does not apply to main branch.

Actions #3

Updated by Dean Brown 9 days ago

added patch for Main

Actions #4

Updated by Marko Lindqvist 9 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #5

Updated by Marko Lindqvist 5 days ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF