Fix crash on respawn in match

master
shivajiva101 2020-08-19 01:50:39 +01:00 committed by GitHub
parent 27d8e50505
commit 0e34d6aaad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -440,16 +440,16 @@ end
-- @return nothing
local function safe_spawn(minp)
local maxp = vector.new(minp.x, minp.y + 30, minp.z)
minp.y = minp.y + 1
local pos = minetest.find_nodes_in_area(minp, maxp, 'air')
local res = minp
for i,v in ipairs(pos) do
if res.y == v.y - 1 then
if i > 1 and res.y == v.y - 1 then
return res -- 2 vertical air nodes
else
res = v
end
end
return minp
end
--- Removes a player hud image if its registered