forked from mirror/openmw-tes3mp
Issue #1887: Equipped items do not emit sounds
Added playing of sounds for equipped items (at this moment only for lights). Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
This commit is contained in:
parent
9fd82212b3
commit
566211e753
1 changed files with 14 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
|
||||||
#include <components/compiler/locals.hpp>
|
#include <components/compiler/locals.hpp>
|
||||||
|
|
||||||
|
@ -85,5 +86,18 @@ namespace MWWorld
|
||||||
invStore.equip(*slot, it, actor);
|
invStore.equip(*slot, it, actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string sound;
|
||||||
|
|
||||||
|
if (object.getTypeName() == typeid(ESM::Light).name())
|
||||||
|
{
|
||||||
|
sound = object.get<ESM::Light>()->mBase->mSound;
|
||||||
|
}
|
||||||
|
if (!sound.empty())
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getSoundManager()->playSound(sound, 1.0f, 1.0f,
|
||||||
|
MWBase::SoundManager::Play_TypeSfx,
|
||||||
|
MWBase::SoundManager::Play_Loop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue