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

actorid
Tom Mason 12 years ago
parent 62a2ba1cc6
commit b035a5aa4a

@ -43,23 +43,46 @@ namespace MWWorld
// Beast races cannot equip shoes / boots
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)
{
// Only notify the player, not npcs
if(actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() )
// Only notify the player, not npcs
if(actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() )
{
if(it.getType() == MWWorld::ContainerStore::Type_Clothing){ // It's shoes
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage15}", std::vector<std::string>());
}
else // It's boots
{
if(it.getType() == MWWorld::ContainerStore::Type_Clothing){ // It's shoes
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage15}", std::vector<std::string>());
}
else // It's boots
{
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

Loading…
Cancel
Save