Skip to content

Commit d786709

Browse files
nate97rdb
authored andcommitted
sfxplayer: fixes bug when using the "node argument" in SoundInterval, also fixes Py3 TypeError exception
Closes panda3d#640
1 parent 204cbe4 commit d786709

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

direct/src/showbase/SfxPlayer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def getLocalizedVolume(self, node, listenerNode = None, cutoff = None):
5353
d = node.getDistance(listenerNode)
5454
else:
5555
d = node.getDistance(base.cam)
56+
if not cutoff:
57+
cutoff = self.cutoffDistance
5658
if d == None or d > cutoff:
5759
volume = 0
5860
else:
@@ -70,9 +72,6 @@ def playSfx(
7072
self, sfx, looping = 0, interrupt = 1, volume = None,
7173
time = 0.0, node=None, listenerNode = None, cutoff = None):
7274
if sfx:
73-
if not cutoff:
74-
cutoff = self.cutoffDistance
75-
7675
self.setFinalVolume(sfx, node, volume, listenerNode, cutoff)
7776

7877
# don't start over if it's already playing, unless

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy