Interesting, it might be related to something I'm trying to fix.
In HotA, they added this "fix"...
*AI returns from an endless loop when having a huge army.
*Добавлен вывод ИИ из бесконечного цикла при слишком большой армии.
... but it is incomplete.
An AI with very large army with the "fix" will sometimes run into battle against very weak opponent and lose.
From my understanding of looking at the HotA fix, their solution is to prevent AI from swapping stacks endlessly.
On my end I achieved a similar result by modifying sub_00491640 GetArmyAIValue so that it only returns positive values, but AI hero still runs in battle and dies.
- Код: Выделить всё
unsigned int __thiscall ssub_00491640 GetArmyAIValue(_Army_ *army)
int i = 0;
result = 0;
while ( i < 7 );
if ( army->type[i] != -1 )
result += o_pCreatureInfo[army->type[i]].fight_value * army->count[i];
I assumed there is another check somewhere but I did not spend any time to look for it so far.