mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
guard on NodePath constructor, and not under hidden
This commit is contained in:
parent
755e1737da
commit
731bee5f24
@ -4,10 +4,15 @@ from direct.distributed import DistributedObjectAI
|
|||||||
|
|
||||||
class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI, NodePath):
|
class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI, NodePath):
|
||||||
def __init__(self, air, name=None):
|
def __init__(self, air, name=None):
|
||||||
DistributedObjectAI.DistributedObjectAI.__init__(self, air)
|
# Be careful not to create multiple NodePath objects
|
||||||
if name is None:
|
try:
|
||||||
name = self.__class__.__name__
|
self.DistributedNodeAI_initialized
|
||||||
NodePath.__init__(self, hidden.attachNewNode(name))
|
except:
|
||||||
|
self.DistributedNodeAI_initialized = 1
|
||||||
|
DistributedObjectAI.DistributedObjectAI.__init__(self, air)
|
||||||
|
if name is None:
|
||||||
|
name = self.__class__.__name__
|
||||||
|
NodePath.__init__(self, name)
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
if not self.isEmpty():
|
if not self.isEmpty():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user