Add 3d_armor support
This commit is contained in:
parent
88aea4acb7
commit
0db05b54ef
@ -1 +1,2 @@
|
||||
ctf
|
||||
3d_armor?
|
||||
|
@ -10,10 +10,16 @@ ctf.hud.register_part(function(player, name, tplayer)
|
||||
end
|
||||
|
||||
if ctf.setting("colors.skins") and text_color and color then
|
||||
if minetest.global_exists("armor") then
|
||||
-- TODO: how should support for skin mods be done?
|
||||
armor.textures[name].skin = "ctf_colors_skin_" .. text_color .. ".png"
|
||||
armor:update_player_visuals(player)
|
||||
else
|
||||
player:set_properties({
|
||||
textures = {"ctf_colors_skin_" .. text_color .. ".png"},
|
||||
textures = {"ctf_colors_skin_" .. text_color .. ".png"}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
if not ctf.hud:exists(player, "ctf:hud_team") then
|
||||
ctf.hud:add(player, "ctf:hud_team", {
|
||||
@ -30,3 +36,19 @@ ctf.hud.register_part(function(player, name, tplayer)
|
||||
ctf.hud:change(player, "ctf:hud_team", "number", color)
|
||||
end
|
||||
end)
|
||||
|
||||
--[[if minetest.global_exists("armor") and armor.get_player_skin then
|
||||
print("3d_armor detected!")
|
||||
local old = armor.get_player_skin
|
||||
function armor.get_player_skin(self, name)
|
||||
local player = ctf.player(name)
|
||||
local team = ctf.team(player.team)
|
||||
if team and team.data.color and ctf.flag_colors[team.data.color] then
|
||||
print("Return ctf_colors_skin_" .. team.data.color .. ".png")
|
||||
return "ctf_colors_skin_" .. team.data.color .. ".png"
|
||||
end
|
||||
print("ctf_colors -!- Reverting to default armor skin")
|
||||
|
||||
return old(self, name)
|
||||
end
|
||||
end]]
|
||||
|
@ -79,7 +79,7 @@ local old_is_protected = minetest.is_protected
|
||||
local r = ctf.setting("flag.nobuild_radius")
|
||||
local rs = r * r
|
||||
function minetest.is_protected(pos, name)
|
||||
if rs == 0 then
|
||||
if r <= 0 or rs == 0 then
|
||||
return old_is_protected(pos, name)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user