Award heal score only to medics

master
ANAND 3 years ago
parent 10585d0663
commit 83da1ec0c4
  1. 4
      mods/ctf/ctf_classes/medic.lua

@ -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
})

Loading…
Cancel
Save