mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Fixes suggested by KittyCat
This commit is contained in:
parent
c59ad62c57
commit
47b8a31317
@ -110,7 +110,7 @@ void MWWorld::InventoryStore::equip (int slot, const ContainerStoreIterator& ite
|
||||
flagAsModified();
|
||||
}
|
||||
|
||||
void MWWorld::InventoryStore::unequipAll()
|
||||
void MWWorld::InventoryStore::unequipAll(const MWWorld::Ptr& actor)
|
||||
{
|
||||
for (int slot=0; slot < MWWorld::InventoryStore::Slots; ++slot)
|
||||
{
|
||||
@ -121,7 +121,7 @@ void MWWorld::InventoryStore::unequipAll()
|
||||
std::string script = MWWorld::Class::get(*it).getScript(*it);
|
||||
|
||||
// Unset OnPCEquip Variable on item's script, if it has a script with that variable declared
|
||||
if(script != "")
|
||||
if((actor.getRefData().getHandle() == "player") && (script != ""))
|
||||
(*it).mRefData->getLocals().setVarByInt(script, "onpcequip", 0);
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ namespace MWWorld
|
||||
|
||||
ContainerStoreIterator getSlot (int slot);
|
||||
|
||||
void unequipAll();
|
||||
void unequipAll(const MWWorld::Ptr& actor);
|
||||
///< Unequip all currently equipped items.
|
||||
|
||||
void autoEquip (const MWWorld::Ptr& npc);
|
||||
|
@ -1861,9 +1861,7 @@ namespace MWWorld
|
||||
|
||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(actor).getInventoryStore(actor);
|
||||
if (werewolf)
|
||||
invStore.unequipAll();
|
||||
else
|
||||
invStore.autoEquip(actor);
|
||||
invStore.unequipAll(actor);
|
||||
|
||||
if (actor.getRefData().getHandle() == "player")
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user