mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-06-28 06:12:00 +02:00
Replace deprecated functions with newer ones
These commits create compatibility with MT/MTG 5.0.0+. However, these commits may/will break with the 0.4-series.
This commit is contained in:
@ -149,7 +149,7 @@ 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):getpos()
|
||||
local playerpos = minetest.get_player_by_name(name):get_pos()
|
||||
local dist1 = vector.distance(playerpos, worldedit.pos1[name])
|
||||
local dist2 = vector.distance(playerpos, worldedit.pos2[name])
|
||||
|
||||
@ -255,4 +255,4 @@ worldedit.translate_direction = function(name, direction)
|
||||
end
|
||||
|
||||
return resaxis, resdir
|
||||
end
|
||||
end
|
||||
|
@ -638,7 +638,7 @@ function worldedit.clear_objects(pos1, pos2)
|
||||
-- Avoid players and WorldEdit entities
|
||||
if not obj:is_player() and (not entity or
|
||||
not entity.name:find("^worldedit:")) then
|
||||
local pos = obj:getpos()
|
||||
local pos = obj:get_pos()
|
||||
if pos.x >= pos1x and pos.x <= pos2x and
|
||||
pos.y >= pos1y and pos.y <= pos2y and
|
||||
pos.z >= pos1z and pos.z <= pos2z then
|
||||
|
Reference in New Issue
Block a user