mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 02:45:31 +00:00
Merge pull request #2232 from elsid/fix_div_by_zero
Do not scale duration when timescale is zero
This commit is contained in:
commit
947bf880df
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue