diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index f54c249..644e997 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -24,6 +24,7 @@ from toontown.hood.MMHoodDataAI import MMHoodDataAI from toontown.hood.TTHoodDataAI import TTHoodDataAI from toontown.pets.PetManagerAI import PetManagerAI from toontown.quest.QuestManagerAI import QuestManagerAI +from toontown.racing import RaceGlobals from toontown.racing.DistributedLeaderBoardAI import DistributedLeaderBoardAI from toontown.racing.DistributedRacePadAI import DistributedRacePadAI from toontown.racing.DistributedViewPadAI import DistributedViewPadAI @@ -281,8 +282,14 @@ class ToontownAIRepository(ToontownInternalRepository): kartPads, kartPadGroups = [], [] if type in dnaData.getName(): if type == 'racing_pad': + nameSplit = dnaData.getName().split('_') racePad = DistributedRacePadAI(self) racePad.setArea(area) + racePad.index = int(nameSplit[2]) + racePad.genre = nameSplit[3] + trackInfo = RaceGlobals.getNextRaceInfo(-1, racePad.genre, racePad.index) + racePad.setTrackInfo([trackInfo[0], trackInfo[1]]) + racePad.laps = trackInfo[2] racePad.generateWithRequired(zoneId) kartPads.append(racePad) kartPadGroups.append(dnaData) diff --git a/toontown/racing/DistributedRacePadAI.py b/toontown/racing/DistributedRacePadAI.py index 494f04f..6736175 100644 --- a/toontown/racing/DistributedRacePadAI.py +++ b/toontown/racing/DistributedRacePadAI.py @@ -19,8 +19,10 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): def __init__(self, air): DistributedKartPadAI.__init__(self, air) FSM.__init__(self, 'DistributedRacePadAI') + self.genre = 'urban' self.state = 'Off' self.trackInfo = [0, 0] + self.laps = 3 def setState(self, state): self.state = state @@ -35,6 +37,9 @@ class DistributedRacePadAI(DistributedKartPadAI, FSM): def getState(self): return self.state, globalClockDelta.getRealNetworkTime() + def setTrackInfo(self, trackInfo): + self.trackInfo = [trackInfo[0], trackInfo[1]] + def getTrackInfo(self): return self.trackInfo