From 4eeaa76c1a8a2534e68d9a4a073940491fe2b188 Mon Sep 17 00:00:00 2001 From: Redmond Urbino Date: Wed, 21 Mar 2007 01:45:57 +0000 Subject: [PATCH] kill crash when closing window from diving game --- direct/src/controls/GravityWalker.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/direct/src/controls/GravityWalker.py b/direct/src/controls/GravityWalker.py index a3bbe5e0f2..f395559467 100755 --- a/direct/src/controls/GravityWalker.py +++ b/direct/src/controls/GravityWalker.py @@ -359,11 +359,12 @@ class GravityWalker(DirectObject.DirectObject): self.cTrav.addCollider(self.cEventSphereNodePath, self.event) self.cTrav.addCollider(self.cRayNodePath, self.lifter) else: - self.cTrav.removeCollider(self.cWallSphereNodePath) - if self.wantFloorSphere: - self.cTrav.removeCollider(self.cFloorSphereNodePath) - self.cTrav.removeCollider(self.cEventSphereNodePath) - self.cTrav.removeCollider(self.cRayNodePath) + if hasattr(self, 'cTrav'): + self.cTrav.removeCollider(self.cWallSphereNodePath) + if self.wantFloorSphere: + self.cTrav.removeCollider(self.cFloorSphereNodePath) + self.cTrav.removeCollider(self.cEventSphereNodePath) + self.cTrav.removeCollider(self.cRayNodePath) def getCollisionsActive(self): assert self.debugPrint("getCollisionsActive() returning=%s"%(