forked from mirror/openmw-tes3mp
Merge pull request #1764 from akortunov/lightfix
Ignore lights without CanCarry flags when NPC selects torch
This commit is contained in:
commit
ecfc5fcd63
2 changed files with 4 additions and 3 deletions
|
@ -32,6 +32,7 @@
|
||||||
Bug #4451: Script fails to compile when using "Begin, [ScriptName]" syntax
|
Bug #4451: Script fails to compile when using "Begin, [ScriptName]" syntax
|
||||||
Bug #4453: Quick keys behaviour is invalid for equipment
|
Bug #4453: Quick keys behaviour is invalid for equipment
|
||||||
Bug #4454: AI opens doors too slow
|
Bug #4454: AI opens doors too slow
|
||||||
|
Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas
|
||||||
Feature #4256: Implement ToggleBorders (TB) console command
|
Feature #4256: Implement ToggleBorders (TB) console command
|
||||||
Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results
|
Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results
|
||||||
Feature #4222: 360° screenshots
|
Feature #4222: 360° screenshots
|
||||||
|
|
|
@ -984,7 +984,8 @@ namespace MWMechanics
|
||||||
MWWorld::ContainerStoreIterator torch = inventoryStore.end();
|
MWWorld::ContainerStoreIterator torch = inventoryStore.end();
|
||||||
for (MWWorld::ContainerStoreIterator it = inventoryStore.begin(); it != inventoryStore.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = inventoryStore.begin(); it != inventoryStore.end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->getTypeName() == typeid(ESM::Light).name())
|
if (it->getTypeName() == typeid(ESM::Light).name() &&
|
||||||
|
it->getClass().canBeEquipped(*it, ptr).first)
|
||||||
{
|
{
|
||||||
torch = it;
|
torch = it;
|
||||||
break;
|
break;
|
||||||
|
@ -1005,8 +1006,7 @@ namespace MWMechanics
|
||||||
heldIter = inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
heldIter = inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||||
|
|
||||||
// If we have a torch and can equip it, then equip it now.
|
// If we have a torch and can equip it, then equip it now.
|
||||||
if (heldIter == inventoryStore.end()
|
if (heldIter == inventoryStore.end())
|
||||||
&& torch->getClass().canBeEquipped(*torch, ptr).first == 1)
|
|
||||||
{
|
{
|
||||||
inventoryStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, torch, ptr);
|
inventoryStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, torch, ptr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue