racing: broken kart pads

This commit is contained in:
John Cote 2020-01-02 12:46:49 -05:00
parent 52edc142da
commit f0767c9739
2 changed files with 22 additions and 2 deletions

View file

@ -27,6 +27,8 @@ 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.DistributedStartingBlockAI import DistributedStartingBlockAI
from toontown.racing.DistributedStartingBlockAI import DistributedViewingBlockAI
from toontown.racing.DistributedViewPadAI import DistributedViewPadAI
from toontown.racing.RaceManagerAI import RaceManagerAI
from toontown.shtiker.CogPageManagerAI import CogPageManagerAI
@ -307,8 +309,22 @@ class ToontownAIRepository(ToontownInternalRepository):
return kartPads, kartPadGroups
def findStartingBlocks(self, dnaData, kartPad):
return [] # TODO
def findStartingBlocks(self, dnaData, pad):
startingBlocks = []
for i in range(dnaData.getNumChildren()):
groupName = dnaData.getName()
block = dnaData.at(i)
blockName = block.getName()
if 'starting_block' in blockName:
cls = DistributedStartingBlockAI if 'racing_pad' in groupName else DistributedViewingBlockAI
x, y, z = block.getPos()
h, p, r = block.getHpr()
padLocationId = int(blockName[-1])
startingBlock = cls(self, pad, x, y, z, h, p, r, padLocationId)
startingBlock.generateWithRequired(pad.zoneId)
startingBlocks.append(startingBlock)
return startingBlocks
def findLeaderBoards(self, dnaData, zoneId):
leaderBoards = []

View file

@ -8,6 +8,7 @@ class DistributedKartPadAI(DistributedObjectAI):
def __init__(self, air):
DistributedObjectAI.__init__(self, air)
self.area = None
self.startingBlocks = []
self.index = -1
def setArea(self, area):
@ -15,3 +16,6 @@ class DistributedKartPadAI(DistributedObjectAI):
def getArea(self):
return self.area
def addStartingBlock(self, startingBlock):
self.startingBlocks.append(startingBlock)