n_stacks = GetSavedCombatArmyCreaturesCount(id, COMBAT_LOSER);
for i = 0,(n_stacks-1) doFrom the message by Jack_of_shadows, I replaced what was there, and the error stopped occurring. Strange, I used the forum search with keywords (GetSavedCombatArmy) and couldn't find his message. Why is that?