Bug #1927
opendai_goldequiv_clause(): Bad dai_players_can_agree_on_ceasefire() return value handling
0%
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
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.
Updated by Marko Lindqvist 3 days ago
- File 0041-AI-Remove-dai_players_can_agree_on_ceasefire.patch 0041-AI-Remove-dai_players_can_agree_on_ceasefire.patch added
- Status changed from New to In Review
- Assignee set to Marko Lindqvist
- Target version set to 3.4.0
This patch is just cleanup, with the assumption that there was/is no actual bug in this.
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