mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
guard for calling setLocation twice
This commit is contained in:
parent
25dd2c7217
commit
0b3f17397b
@ -152,20 +152,22 @@ class DistributedObjectAI(DirectObject.DirectObject):
|
||||
def setLocation(self, parentId, zoneId):
|
||||
oldParentId = self.parentId
|
||||
oldZoneId = self.zoneId
|
||||
self.zoneId = zoneId
|
||||
self.parentId = parentId
|
||||
self.air.changeDOZoneInTables(self, zoneId, oldZoneId)
|
||||
messenger.send(self.getZoneChangeEvent(), [zoneId, oldZoneId])
|
||||
# if we are not going into the quiet zone, send a 'logical' zone
|
||||
# change message
|
||||
if zoneId != DistributedObjectAI.QuietZone:
|
||||
lastLogicalZone = oldZoneId
|
||||
if oldZoneId == DistributedObjectAI.QuietZone:
|
||||
lastLogicalZone = self.lastNonQuietZone
|
||||
self.handleLogicalZoneChange(zoneId, lastLogicalZone)
|
||||
self.lastNonQuietZone = zoneId
|
||||
# self.air.storeObjectLocation(self.doId, parentId, zoneId)
|
||||
self.__location = (parentId, zoneId)
|
||||
if ((oldParentId != parentId) or
|
||||
(oldZoneId != zoneId)):
|
||||
self.zoneId = zoneId
|
||||
self.parentId = parentId
|
||||
self.air.changeDOZoneInTables(self, zoneId, oldZoneId)
|
||||
messenger.send(self.getZoneChangeEvent(), [zoneId, oldZoneId])
|
||||
# if we are not going into the quiet zone, send a 'logical' zone
|
||||
# change message
|
||||
if zoneId != DistributedObjectAI.QuietZone:
|
||||
lastLogicalZone = oldZoneId
|
||||
if oldZoneId == DistributedObjectAI.QuietZone:
|
||||
lastLogicalZone = self.lastNonQuietZone
|
||||
self.handleLogicalZoneChange(zoneId, lastLogicalZone)
|
||||
self.lastNonQuietZone = zoneId
|
||||
# self.air.storeObjectLocation(self.doId, parentId, zoneId)
|
||||
self.__location = (parentId, zoneId)
|
||||
|
||||
def getLocation(self):
|
||||
return self.__location
|
||||
|
Loading…
x
Reference in New Issue
Block a user