Award heal score only to medics

This commit is contained in:
ANAND 2020-06-01 22:17:45 +05:30
parent 10585d0663
commit 83da1ec0c4

View file

@ -79,7 +79,7 @@ minetest.override_item("ctf_bandages:bandage", {
if ctf.player(pname).team == ctf.player(name).team then
local hp = object:get_hp()
local limit = ctf_bandages.heal_percent * object:get_properties().hp_max
if hp > 0 and hp < limit then
if hp > 0 and hp < limit and ctf_classes.get(user).name == "medic" then
local main, match = ctf_stats.player(name)
if main and match then
local reward = 1
@ -87,7 +87,7 @@ minetest.override_item("ctf_bandages:bandage", {
match.score = match.score + reward
hud_score.new(name, {
name = "ctf_stats:heal_score",
name = "ctf_classes:medic_heal",
color = "0x00FF00",
value = reward
})