]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Merge branch 'master' into fruitiex/newpanelhud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index b8e42bdfd5b4a9eb0abad587baaaf74816552ecc..48cd14ee0ac449c70d0a5bce6de438be921b21da 100644 (file)
@@ -294,19 +294,6 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                msg = ColoredTeamName(targ.team); // TODO: check if needed?
                        Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
 
-                       if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
-                       {
-                               LogDeath("suicide", deathtype, targ, targ);
-                               GiveFrags(attacker, targ, -1);
-                       }
-                       // TODO: hmm?
-                       /*
-                               if (targ.killcount > 2)
-                                       bprint ("^1",s,"^1 faded after a ",ftos(targ.killcount)," point spree\n");
-                       */
-
-                       // TODO: wut is this?
-                       // givefrags for logging apparently?
                        if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
                        {
                                LogDeath("suicide", deathtype, targ, targ);
@@ -315,30 +302,42 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
 
                        if (targ.killcount > 2)
                                msg = ftos(targ.killcount);
+                       if(teams_matter && deathtype == DEATH_MIRRORDAMAGE)
+                       {
+                               if(attacker.team == COLOR_TEAM1)
+                                       deathtype = KILL_TEAM_RED;
+                               else
+                                       deathtype = KILL_TEAM_BLUE;
+                       }
+
                        Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE);
                }
                else if (attacker.classname == "player" || attacker.classname == "gib")
                {
                        if(teams_matter && attacker.team == targ.team)
                        {
-                               type = KILL_TEAM;
+                               if(attacker.team == COLOR_TEAM1)
+                                       type = KILL_TEAM_RED;
+                               else
+                                       type = KILL_TEAM_BLUE;
 
                                GiveFrags(attacker, targ, -1);
 
+                               Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
+
                                if (targ.killcount > 2) {
                                        msg = ftos(targ.killcount);
-                                       a = s;
                                }
+
                                if (attacker.killcount > 2) {
                                        msg = ftos(attacker.killcount);
                                        type = KILL_TEAM_SPREE;
                                }
+                               Send_KillNotification(a, s, msg, type, MSG_KILL);
 
                                attacker.killcount = 0;
 
                                LogDeath("tk", deathtype, attacker, targ);
-                               Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
-                               Send_KillNotification(a, msg, "", type, MSG_KILL);
                        }
                        else
                        {
@@ -347,7 +346,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                {
                                        checkrules_firstblood = TRUE;
                                        Send_KillNotification(a, "", "", KILL_FIRST_BLOOD, MSG_KILL);
-                                       // TODO: make these print at newline if they dont
+                                       // TODO: make these print a newline if they dont
                                        Send_CSQC_Centerprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
                                        Send_CSQC_Centerprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
                                }