mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:19:40 +00:00
Silence werewolves' footstep sounds when they are running with their claws sheathed
This commit is contained in:
parent
4086bc4848
commit
0e19c3fdeb
1 changed files with 17 additions and 33 deletions
|
@ -24,6 +24,7 @@
|
||||||
#include "../mwmechanics/combat.hpp"
|
#include "../mwmechanics/combat.hpp"
|
||||||
#include "../mwmechanics/autocalcspell.hpp"
|
#include "../mwmechanics/autocalcspell.hpp"
|
||||||
#include "../mwmechanics/difficultyscaling.hpp"
|
#include "../mwmechanics/difficultyscaling.hpp"
|
||||||
|
#include "../mwmechanics/character.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
#include "../mwworld/actiontalk.hpp"
|
#include "../mwworld/actiontalk.hpp"
|
||||||
|
@ -1220,60 +1221,43 @@ namespace MWClass
|
||||||
|
|
||||||
std::string Npc::getSoundIdFromSndGen(const MWWorld::Ptr &ptr, const std::string &name) const
|
std::string Npc::getSoundIdFromSndGen(const MWWorld::Ptr &ptr, const std::string &name) const
|
||||||
{
|
{
|
||||||
if(name == "left")
|
if(name == "left" || name == "right")
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
Ogre::Vector3 pos(ptr.getRefData().getPosition().pos);
|
Ogre::Vector3 pos(ptr.getRefData().getPosition().pos);
|
||||||
if(world->isSwimming(ptr))
|
if(world->isSwimming(ptr))
|
||||||
return "Swim Left";
|
return (name == "left") ? "Swim Left" : "Swim Right";
|
||||||
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
||||||
return "FootWaterLeft";
|
return (name == "left") ? "FootWaterLeft" : "FootWaterRight";
|
||||||
if(world->isOnGround(ptr))
|
if(world->isOnGround(ptr))
|
||||||
{
|
{
|
||||||
|
if (ptr.getClass().getNpcStats(ptr).isWerewolf()
|
||||||
|
&& ptr.getClass().getCreatureStats(ptr).getStance(MWMechanics::CreatureStats::Stance_Run))
|
||||||
|
{
|
||||||
|
MWMechanics::WeaponType weaponType = MWMechanics::WeapType_None;
|
||||||
|
MWMechanics::getActiveWeapon(ptr.getClass().getCreatureStats(ptr), ptr.getClass().getInventoryStore(ptr), &weaponType);
|
||||||
|
if (weaponType == MWMechanics::WeapType_None)
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
MWWorld::InventoryStore &inv = Npc::getInventoryStore(ptr);
|
MWWorld::InventoryStore &inv = Npc::getInventoryStore(ptr);
|
||||||
MWWorld::ContainerStoreIterator boots = inv.getSlot(MWWorld::InventoryStore::Slot_Boots);
|
MWWorld::ContainerStoreIterator boots = inv.getSlot(MWWorld::InventoryStore::Slot_Boots);
|
||||||
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
||||||
return "FootBareLeft";
|
return (name == "left") ? "FootBareLeft" : "FootBareRight";
|
||||||
|
|
||||||
switch(boots->getClass().getEquipmentSkill(*boots))
|
switch(boots->getClass().getEquipmentSkill(*boots))
|
||||||
{
|
{
|
||||||
case ESM::Skill::LightArmor:
|
case ESM::Skill::LightArmor:
|
||||||
return "FootLightLeft";
|
return (name == "left") ? "FootLightLeft" : "FootLightRight";
|
||||||
case ESM::Skill::MediumArmor:
|
case ESM::Skill::MediumArmor:
|
||||||
return "FootMedLeft";
|
return (name == "left") ? "FootMedLeft" : "FootMedRight";
|
||||||
case ESM::Skill::HeavyArmor:
|
case ESM::Skill::HeavyArmor:
|
||||||
return "FootHeavyLeft";
|
return (name == "left") ? "FootHeavyLeft" : "FootHeavyRight";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if(name == "right")
|
|
||||||
{
|
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
||||||
Ogre::Vector3 pos(ptr.getRefData().getPosition().pos);
|
|
||||||
if(world->isSwimming(ptr))
|
|
||||||
return "Swim Right";
|
|
||||||
if(world->isUnderwater(ptr.getCell(), pos) || world->isWalkingOnWater(ptr))
|
|
||||||
return "FootWaterRight";
|
|
||||||
if(world->isOnGround(ptr))
|
|
||||||
{
|
|
||||||
MWWorld::InventoryStore &inv = Npc::getInventoryStore(ptr);
|
|
||||||
MWWorld::ContainerStoreIterator boots = inv.getSlot(MWWorld::InventoryStore::Slot_Boots);
|
|
||||||
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
|
||||||
return "FootBareRight";
|
|
||||||
|
|
||||||
switch(boots->getClass().getEquipmentSkill(*boots))
|
|
||||||
{
|
|
||||||
case ESM::Skill::LightArmor:
|
|
||||||
return "FootLightRight";
|
|
||||||
case ESM::Skill::MediumArmor:
|
|
||||||
return "FootMedRight";
|
|
||||||
case ESM::Skill::HeavyArmor:
|
|
||||||
return "FootHeavyRight";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if(name == "land")
|
if(name == "land")
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
|
Loading…
Reference in a new issue