mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-22 12:52:22 +01:00
Replace deprecated functions with newer ones (#36)
This commit replaces a few deprecated calls to getpos with get_pos
This commit is contained in:
parent
6218e5884d
commit
5527dc8945
2
hud.lua
2
hud.lua
@ -14,7 +14,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
|
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local pos = vector.round(player:getpos())
|
local pos = vector.round(player:get_pos())
|
||||||
pos = vector.apply(pos, function(p)
|
pos = vector.apply(pos, function(p)
|
||||||
return math.max(math.min(p, 2147483), -2147483)
|
return math.max(math.min(p, 2147483), -2147483)
|
||||||
end)
|
end)
|
||||||
|
2
init.lua
2
init.lua
@ -32,7 +32,7 @@ if not minetest.registered_privileges[areas.config.self_protection_privilege] th
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.settings:get_bool("log_mod") then
|
if minetest.settings:get_bool("log_mods") then
|
||||||
local diffTime = os.clock() - areas.startTime
|
local diffTime = os.clock() - areas.startTime
|
||||||
minetest.log("action", "areas loaded in "..diffTime.."s.")
|
minetest.log("action", "areas loaded in "..diffTime.."s.")
|
||||||
end
|
end
|
||||||
|
4
pos.lua
4
pos.lua
@ -53,7 +53,7 @@ minetest.register_chatcommand("area_pos1", {
|
|||||||
elseif param == "" then
|
elseif param == "" then
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player then
|
if player then
|
||||||
pos = player:getpos()
|
pos = player:get_pos()
|
||||||
else
|
else
|
||||||
return false, "Unable to get position."
|
return false, "Unable to get position."
|
||||||
end
|
end
|
||||||
@ -80,7 +80,7 @@ minetest.register_chatcommand("area_pos2", {
|
|||||||
elseif param == "" then
|
elseif param == "" then
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player then
|
if player then
|
||||||
pos = player:getpos()
|
pos = player:get_pos()
|
||||||
else
|
else
|
||||||
return false, "Unable to get position."
|
return false, "Unable to get position."
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user