Apply item-specific spatial range to use sounds

This commit is contained in:
Jage9
2026-02-27 01:10:32 -05:00
parent 4ed52649f1
commit 47a7aa0a83
7 changed files with 15 additions and 6 deletions

View File

@@ -292,6 +292,7 @@ class ItemUseSoundPacket(BasePacket):
sound: str
x: int
y: int
range: int | None = None
class ItemClockAnnouncePacket(BasePacket):

View File

@@ -1770,6 +1770,7 @@ class SignalingServer:
use_sound = self._resolve_item_use_sound(item)
if use_sound:
sound_x, sound_y = self._get_item_sound_source_position(item)
sound_range = self._get_item_emit_range(item)
await self._broadcast(
ItemUseSoundPacket(
type="item_use_sound",
@@ -1777,6 +1778,7 @@ class SignalingServer:
sound=use_sound,
x=sound_x,
y=sound_y,
range=sound_range,
)
)
if item.type == "clock":