|
|
|
@ -988,15 +988,12 @@ namespace MWMechanics
|
|
|
|
|
heldIter = inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
|
|
|
|
|
|
|
|
|
//If holding a light...
|
|
|
|
|
if(heldIter.getType() == MWWorld::ContainerStore::Type_Light)
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
@ -1013,7 +1010,6 @@ namespace MWMechanics
|
|
|
|
|
heldIter->getClass().setRemainingUsageTime(*heldIter, timeRemaining);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Both NPC and player lights extinguish in water.
|
|
|
|
|
if(world->isSwimming(ptr))
|
|
|
|
|