[Client] Only play sound for trap disarms in currently active cells

This commit is contained in:
David Cernat 2022-07-30 20:44:03 +03:00
parent b5e20d3701
commit 023956fd41

View File

@ -698,7 +698,10 @@ void ObjectList::triggerTrapObjects(MWWorld::CellStore* cellStore)
{
if (baseObject.trapAction == mwmp::BaseObjectList::TRAP_ACTION::DISARM)
{
MWBase::Environment::get().getSoundManager()->playSound3D(ptrFound, "Disarm Trap", 1.0f, 1.0f);
if (mwmp::Main::get().getCellController()->isActiveWorldCell(cell))
{
MWBase::Environment::get().getSoundManager()->playSound3D(ptrFound, "Disarm Trap", 1.0f, 1.0f);
}
}
else if (baseObject.trapAction == mwmp::BaseObjectList::TRAP_ACTION::TRIGGER)
{