From 5c2d4f40d809fc8c9f815f0005b67522d0253947 Mon Sep 17 00:00:00 2001 From: Samir Naik Date: Tue, 1 Mar 2005 00:49:31 +0000 Subject: [PATCH] automatically reparent DistributedNode to its parent --- direct/src/distributed/DistributedNode.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/direct/src/distributed/DistributedNode.py b/direct/src/distributed/DistributedNode.py index 570bf3b697..b4632b6501 100644 --- a/direct/src/distributed/DistributedNode.py +++ b/direct/src/distributed/DistributedNode.py @@ -34,6 +34,13 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath): def generate(self): DistributedObject.DistributedObject.generate(self) self.gotStringParentToken = 0 + if wantOtpServer: + parentId, zoneId = self.getLocation() + # reparent to parent + parent = base.cr.doId2do.get(parentId) + if parent and isinstance(parent, NodePath): + self.reparentTo(parent) + def __cmp__(self, other): # DistributedNode inherits from NodePath, which inherits a