From 6f52b6cf258aa66dfb8e2ae1012a8f3d3596b939 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 14 Dec 2003 01:28:03 +0000 Subject: [PATCH] don't crash if localizing node goes away --- direct/src/showbase/SfxPlayer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/direct/src/showbase/SfxPlayer.py b/direct/src/showbase/SfxPlayer.py index 0c7f3f6e04..4e5d60f7af 100644 --- a/direct/src/showbase/SfxPlayer.py +++ b/direct/src/showbase/SfxPlayer.py @@ -33,8 +33,10 @@ class SfxPlayer: Get the volume that a sound should be played at if it is localized at this node. We compute this wrt the camera """ - d = node.getDistance(base.cam) - if d > self.cutoffDistance: + d = None + if not node.isEmpty(): + d = node.getDistance(base.cam) + if d == None or d > self.cutoffDistance: volume = 0 else: if SfxPlayer.UseInverseSquare: