Move towards unifying (your) creature manipulation with selection
This commit is contained in:
+3
-2
@@ -350,7 +350,8 @@ pushYouOutFromWalls u
|
||||
-- rotate creature as well? behaviour on ledges?
|
||||
muzzleWallCheck :: World -> Creature -> Creature
|
||||
muzzleWallCheck w cr = fromMaybe cr $ do
|
||||
invid <- cr ^? crManipulation . manObject . imRootSelectedItem . unNInt
|
||||
invid <- w ^? hud . manObject . imRootSelectedItem . unNInt
|
||||
--revise1 invid <- cr ^? crManipulation . manObject . imRootSelectedItem . unNInt
|
||||
loc <-
|
||||
invIndents ((\k -> w ^?! cWorld . lWorld . items . ix k) <$> _crInv cr)
|
||||
^? ix invid . _2
|
||||
@@ -368,7 +369,7 @@ muzzleWallCheck w cr = fromMaybe cr $ do
|
||||
x = dotV v' v
|
||||
in cr & crPos . _xy +~ min 1 x *^ v'
|
||||
where
|
||||
f loc = map (muzzlePos loc cr) (itemMuzzles loc)
|
||||
f loc = map (muzzlePos w loc cr) (itemMuzzles loc)
|
||||
g cp wls p = case collidePoint cp p wls of
|
||||
(ep, Just wl) -> Just (ep - p, wl)
|
||||
_ -> Nothing
|
||||
|
||||
Reference in New Issue
Block a user