multiwand: fix crash on left clicking background

This commit is contained in:
Starbeamrainbowlabs 2022-09-18 16:21:36 +01:00
parent cf0be6c1fb
commit 0983e09f50
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -3,11 +3,11 @@ local wea = worldeditadditions
local Vector3 = wea.Vector3 local Vector3 = wea.Vector3
local function push_pos(player_name, pos) local function push_pos(player_name, pos)
pos = Vector3.clone(pos)
if player_name == nil then return end if player_name == nil then return end
if pos == nil then if pos == nil then
worldedit.player_notify(player_name, "[multi wand] Error: Too far away (try raising your maxdist with //farwand maxdist <number>)") worldedit.player_notify(player_name, "[multi wand] Error: Too far away (try raising your maxdist with //farwand maxdist <number>)")
else else
pos = Vector3.clone(pos)
wea_c.pos.push(player_name, pos) wea_c.pos.push(player_name, pos)
worldedit.player_notify(player_name, "[multi wand] Added "..pos..". "..wea_c.pos.count(player_name).." points now registered.") worldedit.player_notify(player_name, "[multi wand] Added "..pos..". "..wea_c.pos.count(player_name).." points now registered.")
end end