Prevent door sounds from playing twice #392 (#425)

This commit is contained in:
ModMaker101
2026-03-04 11:28:37 -05:00
committed by GitHub
parent cea1084978
commit 464cf91f4c

View File

@@ -370,7 +370,9 @@ bool MultiPlayerGameMode::useItemOn(shared_ptr<Player> player, Level *level, sha
// are meant to be directly caused by this. If we don't do this, then the sounds never happen as the tile's use method is only called on the
// server, and that won't allow any sounds that are directly made, or broadcast back level events to us that would make the sound, since we are
// the source of the event.
if( ( t > 0 ) && ( !bTestUseOnly ) && player->isAllowedToUse(Tile::tiles[t]) )
// ---------------------------------------------------------------------------------
// Only call soundOnly version if we didn't already call the tile's use method above
if( !didSomething && ( t > 0 ) && ( !bTestUseOnly ) && player->isAllowedToUse(Tile::tiles[t]) )
{
Tile::tiles[t]->use(level, x, y, z, player, face, clickX, clickY, clickZ, true);
}