1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 09:23:53 +00:00

Merge branch 'torchwood' into 'master'

Don't extinguish held light sources when they're hidden (bug #6910)

Closes #6910

See merge request OpenMW/openmw!2194
This commit is contained in:
psi29a 2022-07-29 09:40:48 +00:00
commit 4ecfc0e9ac
2 changed files with 14 additions and 17 deletions

View file

@ -138,6 +138,7 @@
Bug #6898: Accessing the Quick Inventory menu does not work while in menu mode Bug #6898: Accessing the Quick Inventory menu does not work while in menu mode
Bug #6901: Morrowind.exe soul gem usage discrepancy Bug #6901: Morrowind.exe soul gem usage discrepancy
Bug #6909: Using enchanted items has no animation Bug #6909: Using enchanted items has no animation
Bug #6910: Torches should not be extinguished when not being held
Feature #890: OpenMW-CS: Column filtering Feature #890: OpenMW-CS: Column filtering
Feature #1465: "Reset" argument for AI functions Feature #1465: "Reset" argument for AI functions
Feature #2491: Ability to make OpenMW "portable" Feature #2491: Ability to make OpenMW "portable"

View file

@ -991,15 +991,12 @@ namespace MWMechanics
heldIter = inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft); heldIter = inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
//If holding a light... //If holding a light...
if(heldIter.getType() == MWWorld::ContainerStore::Type_Light)
{
const auto world = MWBase::Environment::get().getWorld(); const auto world = MWBase::Environment::get().getWorld();
MWRender::Animation *anim = world->getAnimation(ptr);
if (heldIter.getType() == MWWorld::ContainerStore::Type_Light && anim && anim->getCarriedLeftShown())
{
// Use time from the player's light // Use time from the player's light
if(isPlayer) if(isPlayer)
{
// But avoid using it up if the light source is hidden
MWRender::Animation *anim = world->getAnimation(ptr);
if (anim && anim->getCarriedLeftShown())
{ {
float timeRemaining = heldIter->getClass().getRemainingUsageTime(*heldIter); float timeRemaining = heldIter->getClass().getRemainingUsageTime(*heldIter);
@ -1016,7 +1013,6 @@ namespace MWMechanics
heldIter->getClass().setRemainingUsageTime(*heldIter, timeRemaining); heldIter->getClass().setRemainingUsageTime(*heldIter, timeRemaining);
} }
} }
}
// Both NPC and player lights extinguish in water. // Both NPC and player lights extinguish in water.
if(world->isSwimming(ptr)) if(world->isSwimming(ptr))