mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-06-28 14:16:18 +02:00
Add nil checks around get_player_by_name()
in case someone uses the commands from ncurses
This commit is contained in:
@ -136,7 +136,8 @@ end
|
||||
|
||||
-- Return the marker that is closest to the player
|
||||
worldedit.marker_get_closest_to_player = function(name)
|
||||
local playerpos = minetest.get_player_by_name(name):get_pos()
|
||||
local player = assert(minetest.get_player_by_name(name))
|
||||
local playerpos = player:get_pos()
|
||||
local dist1 = vector.distance(playerpos, worldedit.pos1[name])
|
||||
local dist2 = vector.distance(playerpos, worldedit.pos2[name])
|
||||
|
||||
|
Reference in New Issue
Block a user