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
162 stars 81 forks source link

//rotate causes server crash #150

Closed aerozoic closed 5 years ago

aerozoic commented 6 years ago

Select an area and run //rotate y 360 and BOOM, server crash with the following error:

2017-12-23 19:16:11: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'worldedit_shortcommands' in callback on_chat_message(): ...mes/UGXrealms/mods/worldedit/worldedit/manipulations.lua:498: Only 90 degree increments are supported!
2017-12-23 19:16:11: ERROR[Main]: Stack Traceback
2017-12-23 19:16:11: ERROR[Main]: ===============
2017-12-23 19:16:11: ERROR[Main]: (2) global C function 'error'
2017-12-23 19:16:11: ERROR[Main]: (3) Lua field 'rotate' at file '/home/UGX/.minetest/games/UGXrealms/mods/worldedit/worldedit/manipulations.lua:498'
2017-12-23 19:16:11: ERROR[Main]:   Local variables:
2017-12-23 19:16:11: ERROR[Main]:    pos1 = table: 0x016afb10  {y:8, x:14136, z:20689}
2017-12-23 19:16:11: ERROR[Main]:    pos2 = table: 0x016afba0  {y:8, x:14139, z:20692}
2017-12-23 19:16:11: ERROR[Main]:    axis = string: "y"
2017-12-23 19:16:11: ERROR[Main]:    angle = number: 0
2017-12-23 19:16:11: ERROR[Main]:    pos1 = table: 0x017ed510  {y:8, x:14136, z:20689}
2017-12-23 19:16:11: ERROR[Main]:    pos2 = table: 0x00f4c9c0  {y:8, x:14139, z:20692}
2017-12-23 19:16:11: ERROR[Main]:    other1 = string: "x"
2017-12-23 19:16:11: ERROR[Main]:    other2 = string: "z"
2017-12-23 19:16:11: ERROR[Main]:    count = nil
2017-12-23 19:16:11: ERROR[Main]: (4) Lua field 'func' at file '/home/UGX/.minetest/games/UGXrealms/mods/worldedit/worldedit_commands/init.lua:868'
2017-12-23 19:16:11: ERROR[Main]:   Local variables:
2017-12-23 19:16:11: ERROR[Main]:    name = string: "mmmm"
2017-12-23 19:16:11: ERROR[Main]:    param = string: "y 360"
2017-12-23 19:16:11: ERROR[Main]:    pos1 = table: 0x016afb10  {y:8, x:14136, z:20689}
2017-12-23 19:16:11: ERROR[Main]:    pos2 = table: 0x016afba0  {y:8, x:14139, z:20692}
2017-12-23 19:16:11: ERROR[Main]:    found = number: 1
2017-12-23 19:16:11: ERROR[Main]:    _ = number: 5
2017-12-23 19:16:11: ERROR[Main]:    axis = string: "y"
2017-12-23 19:16:11: ERROR[Main]:    angle = string: "360"
2017-12-23 19:16:11: ERROR[Main]: (5) Lua function '(anonymous)' at file '/usr/local/share/minetest/builtin/game/chatcommands.lua:30' (best guess)
2017-12-23 19:16:11: ERROR[Main]:   Local variables:
2017-12-23 19:16:11: ERROR[Main]:    name = string: "mmmm"
2017-12-23 19:16:11: ERROR[Main]:    message = string: "//rotate y 360"
2017-12-23 19:16:11: ERROR[Main]:    cmd = string: "/rotate"
2017-12-23 19:16:11: ERROR[Main]:    param = string: "y 360"
2017-12-23 19:16:11: ERROR[Main]:    cmd_def = table: 0x009983f0  {mod_origin:worldedit_shortcommands, params:<axis> <angle>, description:Rotate the current WorldEdit region around the axis <axis> by angle <angle> (90 degree increment), func:function: 0x009986e8, privs:table: 0x00998418}
2017-12-23 19:16:11: ERROR[Main]:    has_privs = boolean: true
2017-12-23 19:16:11: ERROR[Main]:    missing_privs = string: ""
2017-12-23 19:16:11: ERROR[Main]: (6) Lua function 'core' at file '/usr/local/share/minetest/builtin/game/register.lua:412' (best guess)
2017-12-23 19:16:11: ERROR[Main]:   Local variables:
2017-12-23 19:16:11: ERROR[Main]:    callbacks = table: 0x0001a8c0  {1:function: 0x002b8fd0, 2:function: 0x008a7460, 3:function: 0x008cac20}
2017-12-23 19:16:11: ERROR[Main]:    mode = number: 5
2017-12-23 19:16:11: ERROR[Main]:    cb_len = number: 3
2017-12-23 19:16:11: ERROR[Main]:    ret = nil
2017-12-23 19:16:11: ERROR[Main]:    (for index) = number: 1
2017-12-23 19:16:11: ERROR[Main]:    (for limit) = number: 3
2017-12-23 19:16:11: ERROR[Main]:    (for step) = number: 1
2017-12-23 19:16:11: ERROR[Main]:    i = number: 1
2017-12-23 19:16:11: ERROR[Main]:    origin = table: 0x002b9010  {name:register_on_chat_message, mod:*builtin*}

:large_orange_diamond:

sfan5 commented 6 years ago

the only things wrong here are: 1) rotating by 360 is a no-op (which should be supported) 2) the error message should be presented to the user instead of bringing down everything