Browse Source

before detachNodeing avatar, get its world relative position in case we need it

Samir Naik 19 years ago
parent
commit
3a7bb23275
1 changed files with 4 additions and 0 deletions
  1. 4 0
      direct/src/distributed/GridParent.py

+ 4 - 0
direct/src/distributed/GridParent.py

@@ -31,7 +31,11 @@ class GridParent:
     def delete(self):
         if self.av:
             if self.av.getParent() == self.cellOrigin:
+                # Keep render relative pos around in case
+                # the avatar needs it once he gets reparented again
+                avPos = self.av.getPos(render)
                 self.av.detachNode()
+                self.av.setPos(avPos)
             del self.av
             self.av = None
         # Remove the gridNodes