Fix points being for suicide and disable gun damage during buildtime

This commit is contained in:
ClobberXD 2018-11-29 21:22:43 +05:30 committed by rubenwardy
parent 4161ba0bee
commit a3989a6807
2 changed files with 13 additions and 0 deletions

View file

@ -286,6 +286,10 @@ local function calculateKillReward(victim, killer)
end
ctf.register_on_killedplayer(function(victim, killer)
-- Suicide is not encouraged here at CTF
if victim == killer then
return
end
local main, match = ctf_stats.player(killer)
if main and match then
local reward = calculateKillReward(victim, killer)

View file

@ -42,6 +42,15 @@ if singleplayer then
SHOOTER_ALLOW_PLAYERS = false
end
if minetest.global_exists("ctf_match") then
ctf_match.register_on_build_time_start(function()
SHOOTER_ALLOW_PLAYERS = false
end)
ctf_match.register_on_build_time_end(function()
SHOOTER_ALLOW_PLAYERS = true
end)
end
local modpath = minetest.get_modpath(minetest.get_current_modname())
local worldpath = minetest.get_worldpath()
local input = io.open(modpath.."/shooter.conf", "r")