Simplify walk cycle (may decrease frame rate?)

This commit is contained in:
2025-06-19 13:48:53 +01:00
parent e6bb6fb1f3
commit add192741c
2 changed files with 11 additions and 12 deletions
+5 -4
View File
@@ -62,9 +62,10 @@ crUpdate f =
foldCr
[ doDamage -- these two
, checkDeath -- must be in this order 24/7/22
, internalCreatureUpdate
, f
-- , internalCreatureUpdate
, footstepSideEffect
, f
-- , footstepSideEffect
-- , updateInv -- upInv must be called before invSideEff 22.05.23
, invRootItemEffs
, invSideEff
@@ -425,9 +426,9 @@ updateMovement cr
| isFrictionless cr = over crPos (+.+ momentum) cr
| otherwise = cr & crStance %~ updateWalkCycle
where
momentum' = 0.98 *.* (_crPos cr -.- _crOldPos cr)
momentum' = 0.98 *.* (_crPos cr - _crOldPos cr)
momentum
| magV momentum' > 1 = 1 *.* normalizeV momentum'
| magV momentum' > 1 = normalizeV momentum'
| otherwise = momentum'
isFrictionless :: Creature -> Bool