1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 18:39:59 +00:00

Play landing sound manually and ignore land soundgen textkeys (bug #2256)

This commit is contained in:
Capostrophic 2018-08-19 20:41:09 +03:00
parent b748bb11ae
commit 2b45fd84ea
3 changed files with 12 additions and 6 deletions

View File

@ -4,6 +4,7 @@
Bug #1990: Sunrise/sunset not set correct Bug #1990: Sunrise/sunset not set correct
Bug #2131: Lustidrike's spell misses the player every time Bug #2131: Lustidrike's spell misses the player every time
Bug #2222: Fatigue's effect on selling price is backwards Bug #2222: Fatigue's effect on selling price is backwards
Bug #2256: Landing sound not playing when jumping immediately after landing
Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped
Bug #2455: Creatures attacks degrade armor Bug #2455: Creatures attacks degrade armor
Bug #2562: Forcing AI to activate a teleport door sometimes causes a crash Bug #2562: Forcing AI to activate a teleport door sometimes causes a crash

View File

@ -1243,9 +1243,8 @@ namespace MWClass
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3()); osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
if (world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr)) if (world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
return "DefaultLandWater"; return "DefaultLandWater";
if(world->isOnGround(ptr))
return "DefaultLand"; return "DefaultLand";
return "";
} }
if(name == "swimleft") if(name == "swimleft")
return "Swim Left"; return "Swim Left";

View File

@ -939,10 +939,10 @@ void CharacterController::handleTextKey(const std::string &groupname, const std:
} }
std::string sound = mPtr.getClass().getSoundIdFromSndGen(mPtr, soundgen); std::string sound = mPtr.getClass().getSoundIdFromSndGen(mPtr, soundgen);
if(!sound.empty()) if(!sound.empty() && evt.compare(10, evt.size()-10, "land") != 0) // Don't play landing sounds here
{ {
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
if(evt.compare(10, evt.size()-10, "left") == 0 || evt.compare(10, evt.size()-10, "right") == 0 || evt.compare(10, evt.size()-10, "land") == 0) if(evt.compare(10, evt.size()-10, "left") == 0 || evt.compare(10, evt.size()-10, "right") == 0)
{ {
// Don't make foot sounds local for the player, it makes sense to keep them // Don't make foot sounds local for the player, it makes sense to keep them
// positioned on the ground. // positioned on the ground.
@ -2027,6 +2027,12 @@ void CharacterController::update(float duration)
cls.skillUsageSucceeded(mPtr, ESM::Skill::Acrobatics, 1); cls.skillUsageSucceeded(mPtr, ESM::Skill::Acrobatics, 1);
} }
} }
// Play landing sound
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
std::string sound = cls.getSoundIdFromSndGen(mPtr, "land");
if (!sound.empty())
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
} }
else else
{ {