coghq: yup you guessed it fixed more ceo crashes

This commit is contained in:
John Cote 2020-01-14 02:24:16 -05:00
parent 0b92bef17c
commit de283ca597
2 changed files with 3 additions and 1 deletions

View file

@ -315,6 +315,8 @@ class DistributedBanquetTable(DistributedObject.DistributedObject, FSM.FSM, Banq
foodModel.setScale(newScale) foodModel.setScale(newScale)
def foodDetach(self = self, diner = diner): def foodDetach(self = self, diner = diner):
if not diner.getRightHand().getNumChildren():
return
foodModel = diner.getRightHand().getChild(0) foodModel = diner.getRightHand().getChild(0)
(foodModel.reparentTo(serviceLoc),) (foodModel.reparentTo(serviceLoc),)
(foodModel.setPosHpr(0, 0, 0, 0, 0, 0),) (foodModel.setPosHpr(0, 0, 0, 0, 0, 0),)

View file

@ -35,7 +35,7 @@ class DistributedGolfSpot(DistributedObject.DistributedObject, FSM.FSM):
self.golfSpotSmoother.setSmoothMode(SmoothMover.SMOn) self.golfSpotSmoother.setSmoothMode(SmoothMover.SMOn)
self.smoothStarted = 0 self.smoothStarted = 0
self.__broadcastPeriod = 0.2 self.__broadcastPeriod = 0.2
if self.index > len(self.positions): if self.index and self.index > len(self.positions):
self.notify.error('Invalid index %d' % index) self.notify.error('Invalid index %d' % index)
self.fadeTrack = None self.fadeTrack = None
self.setupPowerBar() self.setupPowerBar()