Fix light check for passive mobs in other dimensions. It is apparently the same in all dimensions. If a mob has it's own spawn_check function then that should be used regardless of it's type.
Fixes#4029
Reviewed-on: MineClone2/MineClone2#4030
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: codiac <codiac@inbox.lv>
Co-committed-by: codiac <codiac@inbox.lv>
If a mob was not found in the spawn_dictionary or the non_spawn
dictionary and you tried to use a spawn egg to spawn that mob, the game
would crash. This commit prevents that from happening by adding a check
for mobs that don't exist, and minetest.log throws an error.
Removed mob_light_table, simplied loop, changed return values and
fixed dimension priority error in loop. Slimes also don't have a
hardcoded exception for their light levels anymore, and instead
are apart of spawn specific.
The non_spawn_dictionary will cover all mobs that don't spawn naturally, and holds the the minimum and maximum light values for each of them.
A function has also been created that will go through both the spawn_dictionary and the non_spawn_dictionary and determine which one
a mob exists in, with the execption of slimes which cannot spawn from a custom spawner at the moment.
Mobs who don't have light levels for the world that you are currently trying to set your custom spawner in will default to their overworld values
* Put calculations that are only used conditionally inside the
related `if` block.
* Make code logic more explicit.
* Take logging statement out of return value assignment.
* Remove duplicate assignment.
* Fix a typo in the function's description.