mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 20:36:42 +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 "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Morrowind ignores land soundgen for NPCs
|
||||||
if(name == "land")
|
if(name == "land")
|
||||||
{
|
return "";
|
||||||
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";
|
|
||||||
}
|
|
||||||
if(name == "swimleft")
|
if(name == "swimleft")
|
||||||
return "Swim Left";
|
return "Swim Left";
|
||||||
if(name == "swimright")
|
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);
|
std::string sound = mPtr.getClass().getSoundIdFromSndGen(mPtr, soundgen);
|
||||||
if(!sound.empty())
|
if(!sound.empty())
|
||||||
{
|
{
|
||||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
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,
|
sndMgr->playSound3D(mPtr, sound, volume, pitch, MWSound::Type::Foot,
|
||||||
MWSound::PlayMode::NoPlayerLocal);
|
MWSound::PlayMode::NoPlayerLocal);
|
||||||
}
|
}
|
||||||
|
@ -2071,11 +2067,17 @@ void CharacterController::update(float duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Play landing sound
|
// Play landing sound for NPCs
|
||||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
if (mPtr.getClass().isNpc())
|
||||||
std::string sound = cls.getSoundIdFromSndGen(mPtr, "land");
|
{
|
||||||
if (!sound.empty())
|
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);
|
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue