hot keyerror fix

This commit is contained in:
John Cote 2015-07-21 10:04:58 -04:00
parent 41d8b63ec2
commit 3d8d023af9

View file

@ -356,8 +356,14 @@ class DistributedGardenPlot(DistributedLawnDecor.DistributedLawnDecor):
DistributedLawnDecor.DistributedLawnDecor.makeMovieNode(self)
def setBoxDoId(self, boxId, index):
box = base.cr.doId2do[boxId]
x = GardenGlobals.FLOWER_POS[box.typeIndex][index]
self.index = index
if boxId in base.cr.doId2do:
self.setBox(base.cr.doId2do[boxId])
else:
self.acceptOnce('generate-%d' % boxId, self.setBox)
def setBox(self, box):
x = GardenGlobals.FLOWER_POS[box.typeIndex][self.index]
self.setPos(0, 0, 0)
self.reparentTo(box)
@ -370,4 +376,3 @@ class DistributedGardenPlot(DistributedLawnDecor.DistributedLawnDecor):
return
return DistributedLawnDecor.DistributedLawnDecor.stick2Ground(self, *args, **kwargs)