Commit before removing pressplates
This commit is contained in:
@@ -204,25 +204,23 @@ pjRemoteSetDirection ph pj w = case ph of
|
||||
pjlens = cWorld . lWorld . projectiles . ix (pj ^. pjID)
|
||||
|
||||
moveStuckGrenade :: Int -> Point3 -> Float -> Projectile -> World -> World
|
||||
moveStuckGrenade cid poff d pj w
|
||||
| Just cr <- w ^? cWorld . lWorld . creatures . ix cid =
|
||||
let cpos = cr ^. crPos
|
||||
cdir = cr ^. crDir
|
||||
vel = cpos - cr ^. crOldPos
|
||||
in w
|
||||
& pjlens . pjPos . _xy .~ xyV3 (cpos + rotate3z cdir poff)
|
||||
& pjlens . pjDir .~ d + cdir
|
||||
& pjlens . pjVel .~ vel
|
||||
| otherwise =
|
||||
w & pjlens . pjType .~ Grenade GStick
|
||||
moveStuckGrenade cid poff d pj w = fromMaybe (w & pjlens . pjType .~ Grenade GStick) $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix cid
|
||||
let cpos = cr ^. crPos
|
||||
cdir = cr ^. crDir
|
||||
return $
|
||||
w
|
||||
& pjlens . pjPos . _xy .~ xyV3 (cpos + rotate3z cdir poff)
|
||||
& pjlens . pjDir .~ d + cdir
|
||||
& pjlens . pjVel .~ (cpos - cr ^. crOldPos)
|
||||
where
|
||||
pjlens = cWorld . lWorld . projectiles . ix (pj ^. pjID)
|
||||
|
||||
moveProjectile :: Projectile -> World -> World
|
||||
moveProjectile pj w
|
||||
| Just GStuckWall{} <- pj ^? pjType . gnHitEffect = w
|
||||
| Just (GStuckCreature crid poff d) <- pj ^? pjType . gnHitEffect =
|
||||
moveStuckGrenade crid poff d pj w
|
||||
| Just (GStuckCreature cid poff d) <- pj ^? pjType . gnHitEffect =
|
||||
moveStuckGrenade cid poff d pj w
|
||||
| otherwise = case collide3 sp (sp + _pjVel pj) w of
|
||||
(p, Just (n, OWall wl)) -> shellHitWall p n wl pj w
|
||||
(p, Just (_, OFloor)) -> shellHitFloor p pj w
|
||||
|
||||
Reference in New Issue
Block a user