Skip to content

Commit

Permalink
Fix crash caused by previous commit
Browse files Browse the repository at this point in the history
The game would crash when there was no bonus scarab on the board and one would exit the level (including level complete screen).
  • Loading branch information
jakubg1 committed Aug 17, 2021
1 parent 692ee86 commit f0fe816
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ function Path:spawnScorpion()
end

function Path:destroy()
self.bonusScarab:destroy()
if self.bonusScarab then
self.bonusScarab:destroy()
end
--self.bonusScarab = nil
for i, scorpion in ipairs(self.scorpions) do
scorpion:destroy()
Expand Down

0 comments on commit f0fe816

Please sign in to comment.