mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Play the appropriate foot sound based on footwear
This commit is contained in:
parent
365ea11e86
commit
ac4dfd3b39
1 changed files with 32 additions and 2 deletions
|
@ -673,7 +673,22 @@ namespace MWClass
|
|||
if(world->isUnderwater(ptr.getCell(), pos))
|
||||
return "FootWaterLeft";
|
||||
if(world->isOnGround(ptr))
|
||||
return "FootBareLeft";
|
||||
{
|
||||
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 "FootBareLeft";
|
||||
|
||||
switch(Class::get(*boots).getEquipmentSkill(*boots))
|
||||
{
|
||||
case ESM::Skill::LightArmor:
|
||||
return "FootLightLeft";
|
||||
case ESM::Skill::MediumArmor:
|
||||
return "FootMediumLeft";
|
||||
case ESM::Skill::HeavyArmor:
|
||||
return "FootHeavyLeft";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
if(name == "right")
|
||||
|
@ -683,7 +698,22 @@ namespace MWClass
|
|||
if(world->isUnderwater(ptr.getCell(), pos))
|
||||
return "FootWaterRight";
|
||||
if(world->isOnGround(ptr))
|
||||
return "FootBareRight";
|
||||
{
|
||||
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(Class::get(*boots).getEquipmentSkill(*boots))
|
||||
{
|
||||
case ESM::Skill::LightArmor:
|
||||
return "FootLightRight";
|
||||
case ESM::Skill::MediumArmor:
|
||||
return "FootMediumRight";
|
||||
case ESM::Skill::HeavyArmor:
|
||||
return "FootHeavyRight";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
// TODO: I have no idea what these are supposed to do for NPCs since they use
|
||||
|
|
Loading…
Reference in a new issue