Allow bullets to spawn bullets

This commit is contained in:
2024-12-24 14:17:36 +00:00
parent dc96424de9
commit a79dfa1bb3
2 changed files with 5 additions and 6 deletions
+5 -4
View File
@@ -541,12 +541,13 @@ updateDistortions = updateObjMapMaybe distortions updateDistortion
updateRadarBlips :: World -> World
updateRadarBlips = updateObjMapMaybe radarBlips updateRadarBlip
{- Apply internal particle updates, delete 'Nothing's. -}
-- if changing, make sure that bullets can still spawn new bullets
updateBullets :: World -> World
--updateBullets w = updateInstantBullets $ set (cWorld . lWorld . bullets) (catMaybes ps) w'
updateBullets w = set (cWorld . lWorld . bullets) (catMaybes ps) w'
updateBullets w = w'
& cWorld . lWorld . bullets %~ (++ catMaybes ps)
where
(w', ps) = mapAccumR updateBullet w $ w ^. cWorld . lWorld . bullets
(w', ps) = mapAccumR updateBullet (w & cWorld . lWorld . bullets .~ [])
$ w ^. cWorld . lWorld . bullets
updateTeslaArcs :: World -> World
updateTeslaArcs = updateObjCatMaybes teslaArcs updateTeslaArc