ShadMOrdre / lib_mg_continental

Voronoi influenced terrain generation.
GNU Lesser General Public License v2.1
0 stars 1 forks source link

Fix crash when node_cave_liquid is a table #3

Open gaelysam opened 4 years ago

gaelysam commented 4 years ago

I got this crash

2020-04-06 19:25:51: ERROR[Main]: ModError: Failed to load and run script from /home/gael/.minetest/mods/lib_mg_continental/init.lua:
2020-04-06 19:25:51: ERROR[Main]: ...est/mods/lib_mg_continental/lib_mg_continental_voxel.lua:407: bad argument #1 to 'get_content_id' (string expected, got table)
2020-04-06 19:25:51: ERROR[Main]: stack traceback:
2020-04-06 19:25:51: ERROR[Main]:   [C]: in function 'get_content_id'
2020-04-06 19:25:51: ERROR[Main]:   ...est/mods/lib_mg_continental/lib_mg_continental_voxel.lua:407: in main chunk
2020-04-06 19:25:51: ERROR[Main]:   [C]: in function 'dofile'
2020-04-06 19:25:51: ERROR[Main]:   /home/gael/.minetest/mods/lib_mg_continental/init.lua:47: in main chunk

I propose a workaround by taking the first element of node_cave_liquid when it's a table. I don't know how you want to deal with the table but at least this prevents the crash.

ShadMOrdre commented 4 years ago

This workaround may still be relevant, but I choose to not use registered biomes, to help with on_gen efficiency. I'll keep this open, as it may still apply when using with lib_materials / lib_ecology and default mods.