mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Remove attached sounds when the active object is removed (#14341)
This commit is contained in:
parent
39b1311a1b
commit
63a9853811
7 changed files with 44 additions and 12 deletions
|
@ -2264,6 +2264,22 @@ void Server::fadeSound(s32 handle, float step, float gain)
|
|||
m_playing_sounds.erase(it);
|
||||
}
|
||||
|
||||
void Server::stopAttachedSounds(u16 id)
|
||||
{
|
||||
assert(id);
|
||||
|
||||
for (auto it = m_playing_sounds.begin(); it != m_playing_sounds.end(); ) {
|
||||
const ServerPlayingSound &sound = it->second;
|
||||
|
||||
if (sound.object == id) {
|
||||
// Remove sound reference
|
||||
it = m_playing_sounds.erase(it);
|
||||
}
|
||||
else
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
void Server::sendRemoveNode(v3s16 p, std::unordered_set<u16> *far_players,
|
||||
float far_d_nodes)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue