sfxplayer: fixes bug when using the "node argument" in SoundInterval, also fixes Py3 TypeError exception

Closes #640
This commit is contained in:
nate97 2019-04-30 21:46:16 -05:00 committed by rdb
parent 204cbe4464
commit d786709a49

View File

@ -53,6 +53,8 @@ class SfxPlayer:
d = node.getDistance(listenerNode)
else:
d = node.getDistance(base.cam)
if not cutoff:
cutoff = self.cutoffDistance
if d == None or d > cutoff:
volume = 0
else:
@ -70,9 +72,6 @@ class SfxPlayer:
self, sfx, looping = 0, interrupt = 1, volume = None,
time = 0.0, node=None, listenerNode = None, cutoff = None):
if sfx:
if not cutoff:
cutoff = self.cutoffDistance
self.setFinalVolume(sfx, node, volume, listenerNode, cutoff)
# don't start over if it's already playing, unless