From 00f5bfc3a4fb5bcc832500dd5d50e7eaf50f744e Mon Sep 17 00:00:00 2001 From: John Cote Date: Thu, 2 Jan 2020 21:04:56 -0500 Subject: [PATCH] racing: almost to the race --- toontown/racing/DistributedRacePadAI.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/toontown/racing/DistributedRacePadAI.py b/toontown/racing/DistributedRacePadAI.py index 6084a33..e5571a2 100644 --- a/toontown/racing/DistributedRacePadAI.py +++ b/toontown/racing/DistributedRacePadAI.py @@ -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: