Start refactor storing items in single intmap, done turrets

More checks required
This commit is contained in:
2025-08-24 11:53:21 +01:00
parent 7336177edf
commit c38d03165f
22 changed files with 642 additions and 269 deletions
+3 -3
View File
@@ -1208,11 +1208,11 @@ mcShootLaser _ mc =
mcShootAuto :: Item -> Machine -> World -> World
mcShootAuto itm mc w
| Just (AutoTrigger rate) <- baseItemTriggerType <$> mc ^? mcType . mctTurret . tuWeapon
| Just i <- mc ^? mcType . mctTurret . tuWeapon
, Just (AutoTrigger rate) <- baseItemTriggerType <$> w ^? cWorld . lWorld . items . ix i
, w ^. cWorld . lWorld . lClock - rate > lastused =
w
& cWorld . lWorld . machines . ix (_mcID mc) . mcType . mctTurret . tuWeapon
. itTimeLastUsed
& cWorld . lWorld . items . ix i . itTimeLastUsed
.~ w ^. cWorld . lWorld . lClock
& makeBullet defaultBullet itm pos dir
| otherwise = w