|
|
@@ -1,5 +1,4 @@
|
|
|
|
|
|
-
|
|
|
from DistributedObjectAI import DistributedObjectAI
|
|
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
|
|
|
|
|
@@ -14,14 +13,24 @@ class DistributedObjectGlobalAI(DistributedObjectAI):
|
|
|
doNotDeallocateChannel = 1
|
|
|
isGlobalDistObj = 1
|
|
|
|
|
|
- def __init__(self, air):
|
|
|
+ def __init__(self, air):
|
|
|
DistributedObjectAI.__init__(self, air)
|
|
|
|
|
|
def announceGenerate(self):
|
|
|
- self.air.registerForChannel(self.doId)
|
|
|
DistributedObjectAI.announceGenerate(self)
|
|
|
+ try:
|
|
|
+ if not self.doNotListenToChannel:
|
|
|
+ self.air.registerForChannel(self.doId)
|
|
|
+ except AttributeError:
|
|
|
+ self.air.registerForChannel(self.doId)
|
|
|
+ return False
|
|
|
|
|
|
def delete(self):
|
|
|
- self.air.unregisterForChannel(self.doId)
|
|
|
+ DistributedObjectAI.delete(self)
|
|
|
+ try:
|
|
|
+ if not self.doNotListenToChannel:
|
|
|
+ self.air.unregisterForChannel(self.doId)
|
|
|
+ except AttributeError:
|
|
|
+ self.air.unregisterForChannel(self.doId)
|
|
|
## self.air.removeDOFromTables(self)
|
|
|
- DistributedObjectAI.delete(self)
|
|
|
+
|