mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
beast races cannot equip anything they oughtn't to be able to equip
This commit is contained in:
parent
62a2ba1cc6
commit
b035a5aa4a
@ -43,23 +43,46 @@ 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_Boots)
|
if(*slot == MWWorld::InventoryStore::Slot_Helmet){
|
||||||
{
|
std::vector<ESM::PartReference> parts;
|
||||||
// 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)
|
||||||
{
|
parts = it->get<ESM::Clothing>()->mBase->mParts.mParts;
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector<std::string>());
|
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() )
|
||||||
|
{
|
||||||
|
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>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if all slots are occupied, replace the last slot
|
// if all slots are occupied, replace the last slot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user