From 92ac749757f90a8b0218682b18d9f92e652f42f9 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 22 Nov 2015 19:32:55 +0000 Subject: [PATCH] Add indestructable base to flags --- mods/ctf_match/init.lua | 22 +++++++++++++++++++--- mods/ctf_pvp_engine | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/mods/ctf_match/init.lua b/mods/ctf_match/init.lua index d509b58..292fc78 100644 --- a/mods/ctf_match/init.lua +++ b/mods/ctf_match/init.lua @@ -94,9 +94,25 @@ ctf.register_on_new_game(function() end minetest.after(0, function() - for name, p in pairs(pos) do - safe_place(p, {name = "ctf_flag:flag"}) - ctf_flag.update(p) + for name, flag in pairs(pos) do + safe_place(flag, {name = "ctf_flag:flag"}) + ctf_flag.update(flag) + local function base_at(flag, dx, dz) + safe_place({ + 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) end end) diff --git a/mods/ctf_pvp_engine b/mods/ctf_pvp_engine index f8d56da..85d0eda 160000 --- a/mods/ctf_pvp_engine +++ b/mods/ctf_pvp_engine @@ -1 +1 @@ -Subproject commit f8d56da0f0c8a887de1c4bd584f360b2e6a8a3f0 +Subproject commit 85d0eda86411e2ef2dba5b5155d2764389a83f7f