From ace3c76112a839aaad34f4343cd924412310bbd3 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 25 Jan 2020 21:19:29 +0100 Subject: Improve core.sound_play with ephemeral sounds and player exclusion --- src/server.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index d61840871..28d9c8fa1 100644 --- a/src/server.h +++ b/src/server.h @@ -98,6 +98,7 @@ struct ServerSoundParams v3f pos; u16 object = 0; std::string to_player = ""; + std::string exclude_player = ""; v3f getPos(ServerEnvironment *env, bool *pos_exists) const; }; @@ -209,7 +210,8 @@ public: // Returns -1 if failed, sound handle on success // Envlock - s32 playSound(const SimpleSoundSpec &spec, const ServerSoundParams ¶ms); + s32 playSound(const SimpleSoundSpec &spec, const ServerSoundParams ¶ms, + bool ephemeral=false); void stopSound(s32 handle); void fadeSound(s32 handle, float step, float gain); @@ -646,7 +648,8 @@ private: Sounds */ std::unordered_map m_playing_sounds; - s32 m_next_sound_id = 0; + s32 m_next_sound_id = 0; // positive values only + s32 nextSoundId(); /* Detached inventories (behind m_env_mutex) -- cgit v1.2.3