racing: almost to the race

This commit is contained in:
John Cote 2020-01-02 21:04:56 -05:00
parent 53a854a134
commit 00f5bfc3a4

View file

@ -112,6 +112,19 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM):
if task:
return task.done
def enterRace(self, task):
trackId, raceType = self.trackInfo
circuitLoop = []
if raceType == RaceGlobals.Circuit:
circuitLoop = RaceGlobals.getCircuitLoop(trackId)
raceZone = self.air.raceMgr.createRace(trackId, raceType, self.laps, self.avIds, circuitLoop=circuitLoop[1:], circuitPoints={}, circuitTimes={})
for startingBlock in self.startingBlocks:
self.sendUpdateToAvatarId(startingBlock.avId, 'setRaceZone', [raceZone])
startingBlock.raceExit()
return task.done
def addAvBlock(self, avId, startingBlock, paid):
av = self.air.doId2do.get(avId)
if not av: