Account for unreflected missiles that got destroyed

This commit is contained in:
Juhani Krekelä 2023-06-04 17:29:00 +03:00
parent 7b742c35c4
commit d7146a1d52
1 changed files with 3 additions and 0 deletions

View File

@ -243,6 +243,9 @@ function updateMissiles(dt)
while i <= #missiles do
if missiles[i].y > 1 + missile_radius or not missiles[i].alive then
-- Went off the bottom of the screen or exploded, delete
if not missiles[i].reflected then
unreflected_missiles = unreflected_missiles - 1
end
table.remove(missiles, i)
else
i = i + 1