1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Builtin: Replace deprecated function calls (#7561)

This commit is contained in:
SmallJoker 2018-07-17 20:17:54 +02:00 committed by GitHub
parent a0635f6024
commit ade7a1cbcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 19 deletions

View file

@ -380,7 +380,7 @@ core.register_chatcommand("teleport", {
end
teleportee = core.get_player_by_name(name)
if teleportee then
teleportee:setpos(p)
teleportee:set_pos(p)
return true, "Teleporting to "..core.pos_to_string(p)
end
end
@ -393,12 +393,12 @@ core.register_chatcommand("teleport", {
if target_name then
local target = core.get_player_by_name(target_name)
if target then
p = target:getpos()
p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
teleportee:setpos(p)
teleportee:set_pos(p)
return true, "Teleporting to " .. target_name
.. " at "..core.pos_to_string(p)
end
@ -417,7 +417,7 @@ core.register_chatcommand("teleport", {
teleportee = core.get_player_by_name(teleportee_name)
end
if teleportee and p.x and p.y and p.z then
teleportee:setpos(p)
teleportee:set_pos(p)
return true, "Teleporting " .. teleportee_name
.. " to " .. core.pos_to_string(p)
end
@ -433,12 +433,12 @@ core.register_chatcommand("teleport", {
if target_name then
local target = core.get_player_by_name(target_name)
if target then
p = target:getpos()
p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
teleportee:setpos(p)
teleportee:set_pos(p)
return true, "Teleporting " .. teleportee_name
.. " to " .. target_name
.. " at " .. core.pos_to_string(p)
@ -664,7 +664,7 @@ core.register_chatcommand("spawnentity", {
return false, "Cannot spawn an unknown entity"
end
if p == "" then
p = player:getpos()
p = player:get_pos()
else
p = core.string_to_pos(p)
if p == nil then