mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 17:15:34 +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))
|
if(world->isUnderwater(ptr.getCell(), pos))
|
||||||
return "FootWaterLeft";
|
return "FootWaterLeft";
|
||||||
if(world->isOnGround(ptr))
|
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 "";
|
return "";
|
||||||
}
|
}
|
||||||
if(name == "right")
|
if(name == "right")
|
||||||
|
@ -683,7 +698,22 @@ namespace MWClass
|
||||||
if(world->isUnderwater(ptr.getCell(), pos))
|
if(world->isUnderwater(ptr.getCell(), pos))
|
||||||
return "FootWaterRight";
|
return "FootWaterRight";
|
||||||
if(world->isOnGround(ptr))
|
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 "";
|
return "";
|
||||||
}
|
}
|
||||||
// TODO: I have no idea what these are supposed to do for NPCs since they use
|
// TODO: I have no idea what these are supposed to do for NPCs since they use
|
||||||
|
|
Loading…
Reference in a new issue