Stop you from having wasd control while falling

This commit is contained in:
2026-04-03 21:14:59 +01:00
parent 30b0bb55c0
commit 348a1d7537
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ updateCarriage' cid cr w = \case
(chooseFootSound ff)
Nothing
& over (cWorld . lWorld . creatures . ix cid . crType) resetStride
& tocr . crPos +~ 0.5 *^ (cr ^. crOldPos - oop)
_ -> w & tocr . crPos +~ 0.5 *^ (cr ^. crOldPos - oop)
& tocr . crPos . _xy +~ 0.5 *^ (cr ^. crOldPos - oop) ^. _xy
_ -> w & tocr . crPos . _xy +~ 0.5 *^ (cr ^. crOldPos - oop) ^. _xy
Floating -> w
Flying {_zSpeed = dz, _flyInertia = x} ->
w & cWorld . lWorld . creatures . ix cid . crPos . _xy +~ x *^ f (cr ^. crOldPos . _xy - oop ^. _xy)
+4 -1
View File
@@ -104,7 +104,10 @@ scancodeToHotkey = \case
within wasdMovement should probably be done first
-}
wasdWithAiming :: World -> Creature -> Creature
wasdWithAiming w cr = wasdAim inp w $ wasdMovement (w ^. cWorld . lWorld) inp cam speed cr
wasdWithAiming w cr
| Walking <- cr ^. crStance . carriage
= wasdAim inp w $ wasdMovement (w ^. cWorld . lWorld) inp cam speed cr
| otherwise = cr
where
speed = _mvSpeed $ crMvType cr
inp = w ^. input