mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
don't crash if localizing node goes away
This commit is contained in:
parent
b7c6b8105e
commit
6f52b6cf25
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user