1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 09:53:50 +00:00

beast races cannot equip anything they oughtn't to be able to equip

This commit is contained in:
Tom Mason 2013-01-09 13:18:05 +00:00
parent 62a2ba1cc6
commit b035a5aa4a

View file

@ -43,6 +43,29 @@ namespace MWWorld
// Beast races cannot equip shoes / boots // Beast races cannot equip shoes / boots
if(npcRace == "argonian" || npcRace == "khajiit") if(npcRace == "argonian" || npcRace == "khajiit")
{ {
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
parts = it->get<ESM::Armor>()->mBase->mParts.mParts;
bool allow = true;
for(std::vector<ESM::PartReference>::iterator itr = parts.begin(); itr != parts.end(); ++itr)
{
if((*itr).mPart == ESM::PartReferenceType::PRT_Head)
{
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage13}", std::vector<std::string>());
allow = false;
break;
}
}
if(!allow)
break;
}
if (*slot == MWWorld::InventoryStore::Slot_Boots) if (*slot == MWWorld::InventoryStore::Slot_Boots)
{ {
// Only notify the player, not npcs // Only notify the player, not npcs
@ -57,9 +80,9 @@ namespace MWWorld
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector<std::string>()); MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector<std::string>());
} }
} }
break;
} }
break;
} }
// if all slots are occupied, replace the last slot // if all slots are occupied, replace the last slot