mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-04 17:45:33 +00:00
Re-enable using soundgen land for creatures
This commit is contained in:
parent
53ccce1867
commit
6ef7be3fd3
2 changed files with 14 additions and 18 deletions
|
@ -1242,15 +1242,9 @@ namespace MWClass
|
|||
return "";
|
||||
}
|
||||
|
||||
// Morrowind ignores land soundgen for NPCs
|
||||
if(name == "land")
|
||||
{
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
||||
if (world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
||||
return "DefaultLandWater";
|
||||
|
||||
return "DefaultLand";
|
||||
}
|
||||
return "";
|
||||
if(name == "swimleft")
|
||||
return "Swim Left";
|
||||
if(name == "swimright")
|
||||
|
|
|
@ -979,17 +979,13 @@ void CharacterController::handleTextKey(const std::string &groupname, const std:
|
|||
}
|
||||
}
|
||||
|
||||
if (soundgen == "land") // Morrowind ignores land soundgen for some reason
|
||||
return;
|
||||
|
||||
std::string sound = mPtr.getClass().getSoundIdFromSndGen(mPtr, soundgen);
|
||||
if(!sound.empty())
|
||||
{
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
if(soundgen == "left" || soundgen == "right")
|
||||
// NB: landing sound is not played for NPCs here
|
||||
if(soundgen == "left" || soundgen == "right" || soundgen == "land")
|
||||
{
|
||||
// Don't make foot sounds local for the player, it makes sense to keep them
|
||||
// positioned on the ground.
|
||||
sndMgr->playSound3D(mPtr, sound, volume, pitch, MWSound::Type::Foot,
|
||||
MWSound::PlayMode::NoPlayerLocal);
|
||||
}
|
||||
|
@ -2071,11 +2067,17 @@ void CharacterController::update(float duration)
|
|||
}
|
||||
}
|
||||
|
||||
// Play landing sound
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
std::string sound = cls.getSoundIdFromSndGen(mPtr, "land");
|
||||
if (!sound.empty())
|
||||
// Play landing sound for NPCs
|
||||
if (mPtr.getClass().isNpc())
|
||||
{
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
std::string sound = "DefaultLand";
|
||||
osg::Vec3f pos(mPtr.getRefData().getPosition().asVec3());
|
||||
if (world->isUnderwater(mPtr.getCell(), pos) || world->isWalkingOnWater(mPtr))
|
||||
sound = "DefaultLandWater";
|
||||
|
||||
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue