Project

General

Profile

Actions

Bug #1927

open

dai_goldequiv_clause(): Bad dai_players_can_agree_on_ceasefire() return value handling

Added by Marko Lindqvist 3 days ago. Updated 3 days ago.

Status:
In Review
Priority:
Normal
Category:
AI
Target version:
Start date:
02/02/2026
Due date:
% Done:

0%

Estimated time:

Description

dai_goldequiv_clause() checks, in case of ceasefire -clause, if dai_players_can_agree_on_ceasefire(). The return value handling makes no sense. It's almost the opposite to what it should be (just missing 'not' (!)), but not exactly.
If players cannot agree on ceasefire, the execution continues to normal ceasefire value calculation. If players can agree on ceasefire, value of the ceasefire is set to 0.
Likely it should set value of the ceasefire to a negative value (callers consider that as sign to not continue with the ceasefire, no matter total value of the treaty) in case players cannot accept ceasefire, and use "normal" calculation when they can.


Files

Actions #1

Updated by Marko Lindqvist 3 days ago

Well, the 'normal' handling can only result in negative value or zero. So the check is not reversed.

Actions #2

Updated by Marko Lindqvist 3 days ago

This patch is just cleanup, with the assumption that there was/is no actual bug in this.

Actions #3

Updated by Marko Lindqvist 3 days ago

  • Subject changed from dai_goldequiv_clause(): Bad dai_players_can_agree_on_ceasefire() return alue handling to dai_goldequiv_clause(): Bad dai_players_can_agree_on_ceasefire() return value handling
Actions

Also available in: Atom PDF