Oops, accidentally removed the obj_update function.

This commit is contained in:
Storm Dragon 2025-02-03 23:59:46 -05:00
parent 2df86c9c76
commit 80fe2caff3

View File

@ -333,8 +333,19 @@ def obj_play(sounds, soundName, player_pos, obj_pos, loop=True):
x.set_volume(volume * left, volume * right) x.set_volume(volume * left, volume * right)
return x return x
def obj_update(x, player_pos, obj_pos):
if x is None:
return None
volume, left, right = calculate_volume_and_pan(player_pos, obj_pos)
if volume == 0:
x.stop()
return None
# Apply the volume and pan
x.set_volume(volume * left, volume * right)
return x
def obj_stop(x): def obj_stop(x):
"""Tries to stop a playing object channel""" # Tries to stop a playing object channel
try: try:
x.stop() x.stop()
return None return None