SMUnlimited / AMAI

Advanced Melee Artificial Intelligence Mod For Warcraft 3
Other
211 stars 34 forks source link

LocalizeOldTown should not check GetTownUnitCount > 0 or check > 1 #406

Closed jzy-chitong56 closed 2 weeks ago

jzy-chitong56 commented 2 weeks ago

exitwhen IsUnitType(u, UNIT_TYPE_STRUCTURE) and GetTownUnitCount(GetUnitTypeId(u), num, true) > 0

if u != null , then GetTownUnitCount(id, num, true) must > 0 , so no need check this or check > 1

SMUnlimited commented 2 weeks ago

That is there to ensure amai town num is in sync with the hardcoded town numbering, yes when everything is working correctly its unnecessary. But if there is a mismatch it won't sync the towns up and future checks will hopefully fix up the mismatch.