This commit is contained in:
2025-09-23 17:34:39 +01:00
parent 6984a34c19
commit 398b3a1342
12 changed files with 26 additions and 45 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ putTerminalFull f col mc tm =
defaultSensorWall
Nothing
)
$ \mcpl -> Just $ pt0 (PutWorldUpdate $ const $ over gwWorld $ (setids tmpl btpl mcpl)) (\_ -> f tmpl btpl mcpl)
$ \mcpl -> Just $ pt0 (PutWorldUpdate $ const $ over gwWorld (setids tmpl btpl mcpl)) (\_ -> f tmpl btpl mcpl)
where
setids tmpl btpl mcpl w =
w
+4 -6
View File
@@ -42,16 +42,14 @@ placePlainPSSpot
placePlainPSSpot w rm plmnt shift =
let (i, w') = placeSpotID rm (shiftPSBy shift (_plSpot plmnt)) (_plType plmnt) w
newplmnt = plmnt & plMID ?~ i
((gw,rm')) = maybe ((w', rm & rmPmnts .:~ newplmnt))
(gw,rm') = maybe (w', rm & rmPmnts .:~ newplmnt)
(recrPlace newplmnt w') (_plIDCont plmnt w' newplmnt)
in ((f newplmnt gw,rm'))
in (f newplmnt gw,rm')
where
f x gw = fromMaybe gw $ do
j <- x ^. plExternalID
return $ gw & genPmnt . at j ?~ x
recrPlace newplmnt w' pl =
let (wr) = placeSpot (w', rm & rmPmnts .:~ newplmnt) pl
in (wr)
recrPlace newplmnt w' pl = placeSpot (w', rm & rmPmnts .:~ newplmnt) pl
-- this should be tidied up
placeSpotUsingLink ::
@@ -65,7 +63,7 @@ placeSpotUsingLink ::
placeSpotUsingLink w rm plmnt extract eff fallback = case searchedPoss (_rmPos rm) of
Just (ps, rmposs) -> placeSpot (w, eff (head rmposs) $ rm & rmPos .~ rmposs) (plmnt & plSpot .~ ps)
Nothing -> case fallback of
Nothing -> ((w, rm))
Nothing -> (w, rm)
Just plmnt' -> placeSpot (w, rm) plmnt'
where
searchedPoss [] = Nothing