mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 23:51:09 -04:00
Play trap disarm sound when key used on trapped object
This commit is contained in:
parent
d4e656ceaf
commit
249918612d
@ -7,6 +7,7 @@
|
|||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
#include "../mwworld/failedaction.hpp"
|
#include "../mwworld/failedaction.hpp"
|
||||||
@ -159,7 +160,13 @@ namespace MWClass
|
|||||||
MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}");
|
MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}");
|
||||||
unlock(ptr);
|
unlock(ptr);
|
||||||
// using a key disarms the trap
|
// using a key disarms the trap
|
||||||
|
if(!ptr.getCellRef().getTrap().empty())
|
||||||
|
{
|
||||||
ptr.getCellRef().setTrap("");
|
ptr.getCellRef().setTrap("");
|
||||||
|
MWBase::Environment::get().getSoundManager()->playSound3D(ptr,
|
||||||
|
"Disarm Trap", 1.0f, 1.0f, MWBase::SoundManager::Play_TypeSfx,
|
||||||
|
MWBase::SoundManager::Play_Normal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,7 +131,13 @@ namespace MWClass
|
|||||||
MWBase::Environment::get().getWindowManager()->messageBox(keyName + " #{sKeyUsed}");
|
MWBase::Environment::get().getWindowManager()->messageBox(keyName + " #{sKeyUsed}");
|
||||||
unlock(ptr); //Call the function here. because that makes sense.
|
unlock(ptr); //Call the function here. because that makes sense.
|
||||||
// using a key disarms the trap
|
// using a key disarms the trap
|
||||||
|
if(!ptr.getCellRef().getTrap().empty())
|
||||||
|
{
|
||||||
ptr.getCellRef().setTrap("");
|
ptr.getCellRef().setTrap("");
|
||||||
|
MWBase::Environment::get().getSoundManager()->playSound3D(ptr,
|
||||||
|
"Disarm Trap", 1.0f, 1.0f, MWBase::SoundManager::Play_TypeSfx,
|
||||||
|
MWBase::SoundManager::Play_Normal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!needKey || hasKey)
|
if (!needKey || hasKey)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user