mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
beast races cannot equip shoes/boots
This commit is contained in:
parent
135f0870f7
commit
62a2ba1cc6
1 changed files with 26 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "inventorystore.hpp"
|
||||
#include "player.hpp"
|
||||
|
@ -32,10 +33,35 @@ namespace MWWorld
|
|||
|
||||
assert(it != invStore.end());
|
||||
|
||||
std::string npcRace = actor.get<ESM::NPC>()->mBase->mRace;
|
||||
|
||||
// equip the item in the first free slot
|
||||
for (std::vector<int>::const_iterator slot=slots.first.begin();
|
||||
slot!=slots.first.end(); ++slot)
|
||||
{
|
||||
|
||||
// Beast races cannot equip shoes / boots
|
||||
if(npcRace == "argonian" || npcRace == "khajiit")
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
// if all slots are occupied, replace the last slot
|
||||
if (slot == --slots.first.end())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue