Uberi / Minetest-WorldEdit

The ultimate in-game world editing tool for Minetest! Tons of functionality to help with building, fixing, and more.
https://forum.minetest.net/viewtopic.php?f=11&t=572
GNU Affero General Public License v3.0
160 stars 81 forks source link

deferred_execution() crashes Minetest running Mineclone2, minetest.conf inline comment thing #209

Closed infdivzero closed 1 year ago

infdivzero commented 2 years ago

MCL2's default minetest.conf has a comment after the dedicated_server_step setting like so:

# Performance settings                          
dedicated_server_step = 0.05 #tick rate

This function tries to get this setting and tonumber it, but ends up multiplying nil by 1000000, which causes a crash. Discovered this when trying to stack selections in a MCL2 world.

This is a problem with Minetest's settings parser, the way it's handled here, and/or config file writing conventions.

According to https://github.com/minetest/minetest/issues/3304, looks like Minetest doesn't want to handle inline comments : /

A central settings handler, if worldedit uses other settings elsewhere, could be a good workaround

sfan5 commented 2 years ago

That sounds like a mistake in MCL2 to me, but also WorldEdit should not be expected to handle this. It looks like Minetest internally ignores any trailing characters as long as there is a valid number in the front. :thinking: