mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
sfxplayer: fixes bug when using the "node argument" in SoundInterval, also fixes Py3 TypeError exception
Closes #640
This commit is contained in:
parent
204cbe4464
commit
d786709a49
@ -53,6 +53,8 @@ class SfxPlayer:
|
|||||||
d = node.getDistance(listenerNode)
|
d = node.getDistance(listenerNode)
|
||||||
else:
|
else:
|
||||||
d = node.getDistance(base.cam)
|
d = node.getDistance(base.cam)
|
||||||
|
if not cutoff:
|
||||||
|
cutoff = self.cutoffDistance
|
||||||
if d == None or d > cutoff:
|
if d == None or d > cutoff:
|
||||||
volume = 0
|
volume = 0
|
||||||
else:
|
else:
|
||||||
@ -70,9 +72,6 @@ class SfxPlayer:
|
|||||||
self, sfx, looping = 0, interrupt = 1, volume = None,
|
self, sfx, looping = 0, interrupt = 1, volume = None,
|
||||||
time = 0.0, node=None, listenerNode = None, cutoff = None):
|
time = 0.0, node=None, listenerNode = None, cutoff = None):
|
||||||
if sfx:
|
if sfx:
|
||||||
if not cutoff:
|
|
||||||
cutoff = self.cutoffDistance
|
|
||||||
|
|
||||||
self.setFinalVolume(sfx, node, volume, listenerNode, cutoff)
|
self.setFinalVolume(sfx, node, volume, listenerNode, cutoff)
|
||||||
|
|
||||||
# don't start over if it's already playing, unless
|
# don't start over if it's already playing, unless
|
||||||
|
Loading…
x
Reference in New Issue
Block a user