From 94e5b5519c56a54e244b3a191a341e6fafaafa2a Mon Sep 17 00:00:00 2001 From: Xilmi Date: Mon, 8 Jul 2024 16:53:14 +0200 Subject: [PATCH] Fixed AI constantly visiting towns thinking they can get a huge upgrade Due to morale-considerations the AI sometimes calculated that their strongest army after doing an exchange had slightly lower total value than the army they used before. But by using unsigned "slightly lower" became near infinite. So they constantly wanted to upgrade their army because they considered it more useful than anything else. Changing the unsigned into signed fixes this. --- AI/Nullkiller/Analyzers/ArmyManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AI/Nullkiller/Analyzers/ArmyManager.h b/AI/Nullkiller/Analyzers/ArmyManager.h index 1617bd1bd..96b178c6d 100644 --- a/AI/Nullkiller/Analyzers/ArmyManager.h +++ b/AI/Nullkiller/Analyzers/ArmyManager.h @@ -32,7 +32,7 @@ struct SlotInfo struct ArmyUpgradeInfo { std::vector resultingArmy; - uint64_t upgradeValue = 0; + int64_t upgradeValue = 0; TResources upgradeCost; void addArmyToBuy(std::vector army);