1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00

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.
This commit is contained in:
Xilmi 2024-07-08 16:53:14 +02:00
parent d4308c2ce4
commit 94e5b5519c

View File

@ -32,7 +32,7 @@ struct SlotInfo
struct ArmyUpgradeInfo
{
std::vector<SlotInfo> resultingArmy;
uint64_t upgradeValue = 0;
int64_t upgradeValue = 0;
TResources upgradeCost;
void addArmyToBuy(std::vector<SlotInfo> army);