1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Fix the firstguard armor mod

This commit is contained in:
scrawl 2013-03-12 02:02:59 +01:00
parent bcdab2aeab
commit 543f573739

View file

@ -47,9 +47,9 @@ namespace MWWorld
// Beast races cannot equip shoes / boots, or full helms (head part vs hair part)
if(npcRace == "argonian" || npcRace == "khajiit")
{
if(*slot == MWWorld::InventoryStore::Slot_Helmet){
if(*slot == MWWorld::InventoryStore::Slot_Helmet)
{
std::vector<ESM::PartReference> parts;
if(it.getType() == MWWorld::ContainerStore::Type_Clothing)
parts = it->get<ESM::Clothing>()->mBase->mParts.mParts;
else
@ -74,6 +74,17 @@ namespace MWWorld
if (*slot == MWWorld::InventoryStore::Slot_Boots)
{
bool allow = true;
std::vector<ESM::PartReference> parts;
if(it.getType() == MWWorld::ContainerStore::Type_Clothing)
parts = it->get<ESM::Clothing>()->mBase->mParts.mParts;
else
parts = it->get<ESM::Armor>()->mBase->mParts.mParts;
for(std::vector<ESM::PartReference>::iterator itr = parts.begin(); itr != parts.end(); ++itr)
{
if((*itr).mPart == ESM::PRT_LFoot || (*itr).mPart == ESM::PRT_RFoot)
{
allow = false;
// Only notify the player, not npcs
if(actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() )
{
@ -88,6 +99,11 @@ namespace MWWorld
}
break;
}
}
if(!allow)
break;
}
}