From: terencehill Date: Thu, 4 Jan 2024 01:04:20 +0000 (+0100) Subject: Freeze Tag: fix players getting 1 point for a teamkill (they get -1 points now) and... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ef216ee7190f035aa439bb363b0a429b02a84334;p=xonotic%2Fxonotic-data.pk3dir.git Freeze Tag: fix players getting 1 point for a teamkill (they get -1 points now) and not getting -1 points if killed by a map entity (e.g. triggerhurt) --- diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 77fbfc231..3f7fff9eb 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -167,8 +167,11 @@ void freezetag_Add_Score(entity targ, entity attacker) { // got frozen by an enemy // counted as "kill" and "death" already + if(SAME_TEAM(attacker, targ)) + GameRules_scoring_add(attacker, SCORE, -1); + else + GameRules_scoring_add(attacker, SCORE, +1); GameRules_scoring_add(targ, SCORE, -1); - GameRules_scoring_add(attacker, SCORE, +1); } // else nothing - got frozen by the game type rules themselves } @@ -365,6 +368,11 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) if(ITEM_DAMAGE_NEEDKILL(frag_deathtype)) { + // can't use freezetag_Add_Score here since it doesn't assign any points + // if the attacker is not a player (e.g. triggerhurt) by design + if ((STAT(FROZEN, frag_target) != FROZEN_NORMAL) && !IS_PLAYER(frag_attacker)) + GameRules_scoring_add(frag_target, SCORE, -1); + // by restoring some health right after player death (soft-kill) // weapons and ammo won't be reset SetResourceExplicit(frag_target, RES_HEALTH, 1);