jakubg1 / OpenSMCE

Game engine which allows creating a broad range of marble popper games.
MIT License
14 stars 11 forks source link

Crash when not including colorsRemoveIfNonexistent in color generator #109

Closed bchantech closed 1 year ago

bchantech commented 1 year ago

If colorsRemoveIfNonexistent is not defined in the color generator json the engine crashes with this error.

src/mathmethods.lua:2: bad argument #1 to 'pairs' (table expected, got nil)

Traceback:

crash.lua:55: in function 'handler'
[C]: in function 'pairs'
src/mathmethods.lua:2: in function '_MathIsValueInTable'
src/Shooter.lua:154: in function 'update'
src/Level.lua:167: in function 'updateLogic'
src/Level.lua:155: in function 'update'
src/Session.lua:43: in function 'update'
src/Game.lua:124: in function 'tick'
src/Game.lua:112: in function 'update'
main.lua:115: in function 'update'
[love "callbacks.lua"]:162: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
jakubg1 commented 1 year ago

Fixed in https://github.com/jakubg1/OpenSMCE/commit/1789eca7ccbe04622bbc4d08e059f4523d3e1a33 by making this field optional.