Start refactor storing items in single intmap, done turrets
More checks required
This commit is contained in:
@@ -20,9 +20,11 @@ destroyMachine mc =
|
||||
. destroyMcType (mc ^. mcType) mc
|
||||
|
||||
destroyMcType :: MachineType -> Machine -> World -> World
|
||||
destroyMcType mt mc = case mt of
|
||||
McTurret tu -> copyItemToFloor (_mcPos mc) (_tuWeapon tu)
|
||||
_ -> id
|
||||
destroyMcType mt mc w = case mt of
|
||||
McTurret tu -> fromMaybe w $ do
|
||||
itm <- w ^? cWorld . lWorld . items . ix (tu ^. tuWeapon)
|
||||
return $ copyItemToFloor (_mcPos mc) itm w
|
||||
_ -> w
|
||||
|
||||
mcKillTerm :: Machine -> World -> World
|
||||
mcKillTerm mc w = fromMaybe w $ do
|
||||
|
||||
Reference in New Issue
Block a user