Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-diagonal borders water detect #1202

Merged
merged 3 commits into from
Aug 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mods/ctf/ctf_map/map_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function ctf_map.remove_barrier(mapmeta, pos2, callback)

-- Shave off ~0.1 seconds from the main loop
minetest.handle_async(function(d, p1, p2, barrier_nodes, t)
local mod = {} -- All its contents will be recreated in the loop
local Nx = p2.x - p1.x + 1
local Ny = p2.y - p1.y + 1
local ID_IGNORE = minetest.CONTENT_IGNORE
Expand Down Expand Up @@ -107,21 +108,21 @@ function ctf_map.remove_barrier(mapmeta, pos2, callback)
end
end
end
d[vi] = replacement_this
mod[vi] = replacement_this
done = true
break
end
end

-- Avoid changing nodes players placed during async
if not done then
d[vi] = ID_IGNORE
mod[vi] = ID_IGNORE
end
end
end
end

return d
return mod
end, function(d)
vm:set_data(d)
vm:update_liquids()
Expand Down