mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
Fix rare crash with warps (when player:getpos returns nil)
This commit is contained in:
parent
5f1aa7a47b
commit
2aab854a4f
@ -147,6 +147,9 @@ minetest.register_chatcommand("setwarp", {
|
||||
end
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local pos = player:getpos()
|
||||
if not pos then
|
||||
return false, "Internal error while getting your position. Please try again later"
|
||||
end
|
||||
table.insert(warps, { name = param, x = pos.x, y = pos.y, z = pos.z, yaw = player:get_look_yaw(), pitch = player:get_look_pitch() })
|
||||
save()
|
||||
minetest.log("action", name .. " " .. h .. " warp \"" .. param .. "\": " .. pos.x .. ", " .. pos.y .. ", " .. pos.z)
|
||||
|
Loading…
Reference in New Issue
Block a user