mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 15:39:41 +00:00
Make fatigue and magicka recalculation behave the same way
This commit is contained in:
parent
8bdce3ebef
commit
5e4beb217a
3 changed files with 3 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
||||||
Bug #5483: AutoCalc flag is not used to calculate spells cost
|
Bug #5483: AutoCalc flag is not used to calculate spells cost
|
||||||
Bug #6066: addtopic "return" does not work from within script. No errors thrown
|
Bug #6066: addtopic "return" does not work from within script. No errors thrown
|
||||||
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
|
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
|
||||||
|
Bug #6107: Fatigue is incorrectly recalculated when fortify effect is applied or removed
|
||||||
Bug #6115: Showmap overzealous matching
|
Bug #6115: Showmap overzealous matching
|
||||||
|
|
||||||
0.47.0
|
0.47.0
|
||||||
|
|
|
@ -826,7 +826,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
DynamicStat<float> magicka = creatureStats.getMagicka();
|
DynamicStat<float> magicka = creatureStats.getMagicka();
|
||||||
float diff = (static_cast<int>(magickaFactor*intelligence)) - magicka.getBase();
|
float diff = (static_cast<int>(magickaFactor*intelligence)) - magicka.getBase();
|
||||||
float currentToBaseRatio = (magicka.getCurrent() / magicka.getBase());
|
float currentToBaseRatio = magicka.getBase() > 0 ? magicka.getCurrent() / magicka.getBase() : 0;
|
||||||
magicka.setModified(magicka.getModified() + diff, 0);
|
magicka.setModified(magicka.getModified() + diff, 0);
|
||||||
magicka.setCurrent(magicka.getBase() * currentToBaseRatio, false, true);
|
magicka.setCurrent(magicka.getBase() * currentToBaseRatio, false, true);
|
||||||
creatureStats.setMagicka(magicka);
|
creatureStats.setMagicka(magicka);
|
||||||
|
|
|
@ -159,7 +159,7 @@ namespace MWMechanics
|
||||||
float diff = (strength+willpower+agility+endurance) - fatigue.getBase();
|
float diff = (strength+willpower+agility+endurance) - fatigue.getBase();
|
||||||
float currentToBaseRatio = fatigue.getBase() > 0 ? (fatigue.getCurrent() / fatigue.getBase()) : 0;
|
float currentToBaseRatio = fatigue.getBase() > 0 ? (fatigue.getCurrent() / fatigue.getBase()) : 0;
|
||||||
fatigue.setModified(fatigue.getModified() + diff, 0);
|
fatigue.setModified(fatigue.getModified() + diff, 0);
|
||||||
fatigue.setCurrent(fatigue.getBase() * currentToBaseRatio);
|
fatigue.setCurrent(fatigue.getBase() * currentToBaseRatio, false, true);
|
||||||
setFatigue(fatigue);
|
setFatigue(fatigue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue