Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -11,7 +11,7 @@ import LensHelp
|
||||
|
||||
destroyMachine :: Machine -> World -> World
|
||||
destroyMachine mc =
|
||||
(cWorld . machines %~ IM.delete (_mcID mc))
|
||||
(cWorld . lWorld . machines %~ IM.delete (_mcID mc))
|
||||
. deleteWallIDs (_mcWallIDs mc)
|
||||
. makeExplosionAt (_mcPos mc)
|
||||
. mcKillTerm mc
|
||||
@@ -26,7 +26,7 @@ destroyMcType mt mc = case mt of
|
||||
mcKillTerm :: Machine -> World -> World
|
||||
mcKillTerm mc w = fromMaybe w $ do
|
||||
tmid <- mc ^? mcMounts . ix ObTerminal
|
||||
tm <- w ^? cWorld . terminals . ix tmid
|
||||
tm <- w ^? cWorld . lWorld . terminals . ix tmid
|
||||
return $
|
||||
w
|
||||
& doTmWdWd (_tmDeathEffect tm) tm
|
||||
@@ -34,4 +34,4 @@ mcKillTerm mc w = fromMaybe w $ do
|
||||
mcKillBut :: Machine -> World -> World
|
||||
mcKillBut mc w = fromMaybe w $ do
|
||||
btid <- mc ^? mcMounts . ix ObButton
|
||||
return $ w & cWorld . buttons . at btid .~ Nothing
|
||||
return $ w & cWorld . lWorld . buttons . at btid .~ Nothing
|
||||
|
||||
Reference in New Issue
Block a user