Remove ind_base from ctf_pvp_engine, fix ctf_flag.update not being called
This commit is contained in:
parent
9804ec7518
commit
622dcb8468
@ -190,29 +190,9 @@ function ctf_flag.assert_flag(flag)
|
|||||||
if nodename ~= "ctf_flag:flag" then
|
if nodename ~= "ctf_flag:flag" then
|
||||||
ctf.log("flag", flag.team .. " has wrong node at flag position, " .. nodename .. ", correcting...")
|
ctf.log("flag", flag.team .. " has wrong node at flag position, " .. nodename .. ", correcting...")
|
||||||
minetest.set_node(flag, { name = "ctf_flag:flag"})
|
minetest.set_node(flag, { name = "ctf_flag:flag"})
|
||||||
|
|
||||||
local function base_at(flag, dx, dz)
|
|
||||||
minetest.set_node({
|
|
||||||
x = flag.x + dx,
|
|
||||||
y = flag.y - 1,
|
|
||||||
z = flag.z + dz,
|
|
||||||
}, { name = "ctf_flag:ind_base"})
|
|
||||||
end
|
|
||||||
base_at(flag, -1, -1)
|
|
||||||
base_at(flag, -1, 0)
|
|
||||||
base_at(flag, -1, 1)
|
|
||||||
base_at(flag, 0, -1)
|
|
||||||
base_at(flag, 0, 0)
|
|
||||||
base_at(flag, 0, 1)
|
|
||||||
base_at(flag, 1, -1)
|
|
||||||
base_at(flag, 1, 0)
|
|
||||||
base_at(flag, 1, 1)
|
|
||||||
|
|
||||||
if minetest.get_node(flag).name ~= "ctf_flag:flag" then
|
|
||||||
ctf_flag.update(flag)
|
ctf_flag.update(flag)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function ctf_flag.assert_flags()
|
function ctf_flag.assert_flags()
|
||||||
for tname, team in pairs(ctf.teams) do
|
for tname, team in pairs(ctf.teams) do
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
minetest.register_node("ctf_flag:ind_base", {
|
|
||||||
description = "Cheater!",
|
|
||||||
groups = {immortal = 1},
|
|
||||||
tiles = {"default_stone.png"},
|
|
||||||
is_ground_content = false
|
|
||||||
})
|
|
||||||
|
|
||||||
-- The flag
|
-- The flag
|
||||||
minetest.register_node("ctf_flag:flag", {
|
minetest.register_node("ctf_flag:flag", {
|
||||||
description = "Flag",
|
description = "Flag",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user