Modified sone Ai's to not always listen do the DOID channel.. This supports a Ai being a client to another AI
This commit is contained in:
parent
a9259e8964
commit
9a23134a7e
|
|
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue