Better check for wall collisions when expanding creature

This commit is contained in:
2021-11-19 23:22:49 +00:00
parent 51d89982ed
commit 9f4ff3a75a
4 changed files with 34 additions and 23 deletions
+5 -4
View File
@@ -8,7 +8,7 @@ module Dodge.Creature.Action
, dropUnselected
, startReloadingWeapon
, blinkAction
, maybeSizeSelf
, sizeSelf
, crAutoReload
, copyInvItemToFloor
, youDropItem
@@ -295,9 +295,10 @@ pickUpItem cid flit w = case maybeInvSlot of
Nothing -> w'
Just j -> w' & itemPositions . ix j .~ InInv 0 invid
maybeSizeSelf :: Float -> Creature -> World -> Maybe World
maybeSizeSelf x cr w
| _crPos cr1 == _crPos cr2 = Just $ w
sizeSelf :: Float -> Creature -> World -> Maybe World
sizeSelf x cr w
-- | _crPos cr1 == _crPos cr2 = Just $ w
| not (crOnWall cr1 w) = Just $ w
& soundMultiFrom [TeleSound 0,TeleSound 1] cpos teleS Nothing
& over distortions (distortionBulge :)
& creatures . ix cid %~