1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Do not scale duration when timescale is zero

This commit is contained in:
elsid 2019-03-09 16:38:41 +03:00
parent 573e64e9c9
commit d3bdf912a4
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -290,7 +290,9 @@ namespace MWMechanics
void MechanicsManager::advanceTime (float duration)
{
// Uses ingame time, but scaled to real time
duration /= MWBase::Environment::get().getWorld()->getTimeScaleFactor();
const float timeScaleFactor = MWBase::Environment::get().getWorld()->getTimeScaleFactor();
if (timeScaleFactor != 0.0f)
duration /= timeScaleFactor;
MWWorld::Ptr player = getPlayer();
player.getClass().getInventoryStore(player).rechargeItems(duration);
}