Make combat log count as death
This commit is contained in:
parent
f8cb85be9f
commit
eb71f5e385
1 changed files with 13 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
potential_cowards = {}
|
potential_cowards = {}
|
||||||
local TIMER_UPDATE_INTERVAL = 2
|
local TIMER_UPDATE_INTERVAL = 2
|
||||||
local COMBAT_TIMEOUT_TIME = 20
|
local COMBAT_TIMEOUT_TIME = 20
|
||||||
|
local COMBATLOG_SCORE_PENALTY = 10
|
||||||
|
|
||||||
--
|
--
|
||||||
--- Make suicides and combat logs award last puncher with kill
|
--- Make suicides and combat logs award last puncher with kill
|
||||||
|
@ -136,6 +137,17 @@ minetest.register_on_leaveplayer(function(player, timeout)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local main, match = ctf_stats.player(pname)
|
||||||
|
|
||||||
|
if main and match then
|
||||||
|
main.deaths = main.deaths + 1
|
||||||
|
match.deaths = match.deaths + 1
|
||||||
|
main.score = main.score - COMBATLOG_SCORE_PENALTY
|
||||||
|
match.score = match.score - COMBATLOG_SCORE_PENALTY
|
||||||
|
match.kills_since_death = 0
|
||||||
|
ctf_stats.request_save()
|
||||||
|
end
|
||||||
|
|
||||||
potential_cowards[pname] = nil
|
potential_cowards[pname] = nil
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue