sbrl / Minetest-WorldEditAdditions

Extra tools and commands to extend WorldEdit for Minetest
https://worldeditadditions.mooncarrot.space/
Mozilla Public License 2.0
16 stars 3 forks source link

crash #92

Closed fluxionary closed 1 year ago

fluxionary commented 1 year ago

issue this command: //for do status

2023-05-19 10:50:51: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'worldeditadditions_commands' in callback on_chat_message(): ...itions/worldeditadditions_commands/commands/meta/for.lua:73: attempt to concatenate local 'command' (a nil value)
2023-05-19 10:50:51: ERROR[Main]: stack traceback:
2023-05-19 10:50:51: ERROR[Main]:   ...itions/worldeditadditions_commands/commands/meta/for.lua:73: in function 'func'
2023-05-19 10:50:51: ERROR[Main]:   ...itadditions/worldeditadditions_core/core/run_command.lua:9: in function 'run_command_stage2'
2023-05-19 10:50:51: ERROR[Main]:   ...itadditions/worldeditadditions_core/core/run_command.lua:53: in function 'run_command'
2023-05-19 10:50:51: ERROR[Main]:   ...itions/worldeditadditions_core/core/register_command.lua:57: in function 'func'
2023-05-19 10:50:51: ERROR[Main]:   /opt/minetest/bin/../builtin/profiler/instrumentation.lua:108: in function 'func'
2023-05-19 10:50:51: ERROR[Main]:   /opt/minetest/bin/../builtin/game/chat.lua:79: in function 'func'
2023-05-19 10:50:51: ERROR[Main]:   /opt/minetest/bin/../builtin/profiler/instrumentation.lua:108: in function </opt/minetest/bin/../builtin/profiler/instrumentation.lua:101>
2023-05-19 10:50:51: ERROR[Main]:   /opt/minetest/bin/../builtin/game/register.lua:448: in function </opt/minetest/bin/../builtin/game/register.lua:434>
VorTechnix commented 1 year ago

Seems like incorrect command usage (no values between for and do). See: https://worldeditadditions.mooncarrot.space/Reference/#for

sbrl commented 1 year ago

The //for command needs a list of items to substitute into the command.

For example, I could run this:

//for 1 2 3 do //shift y %%

...which would expand into running the following commands in sequence:

//for 1 2 3 do //shift y 1
//for 1 2 3 do //shift y 2
//for 1 2 3 do //shift y 3

Regardless, a fix has been implemented to avoid a crash in this scenario, because crashes are bad an d we don't want an entire server to be brought down just because of a mistake in a command :P

sbrl commented 1 year ago

If there is still more to discuss, we can always reopen.

fluxionary commented 1 year ago

i understand that the arguments were wrong. providing wrong arguments to a command shouldn't crash the server (outside of things like //lua).

VorTechnix commented 1 year ago

Yah, that should be fixed now.