Fix AI random crash

This commit is contained in:
loblao 2015-03-15 12:33:33 -03:00
parent 3c41567f52
commit d975331905

View file

@ -230,6 +230,9 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI):
nextLeg = self.legList.getLegIndexAtTime(elapsed, self.currentLeg)
numLegs = self.legList.getNumLegs()
if self.currentLeg != nextLeg:
if nextLeg >= numLegs:
self.flyAwayNow()
return Task.done
self.currentLeg = nextLeg
self.__beginLegType(self.legList.getType(nextLeg))
zoneId = self.legList.getZoneId(nextLeg)