]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/player.qc
Call PlayerDamaged even if damage is 0. Very useful in instagib.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / player.qc
index 8598bc095e76871416d0b535c7667185e09ad080..5aae35599964402a4f63b5ddddf50484f8ae845d 100644 (file)
@@ -506,10 +506,8 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        {
                WeaponStats_LogDamage(awep.m_id, abot, this.(weaponentity).m_weapon.m_id, vbot, dh + da);
        }
-       if (damage)
-       {
-               MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
-       }
+
+       MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
 
        if (this.health < 1)
        {
@@ -658,6 +656,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                                ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0;
                        }
                ));
+               MUTATOR_CALLHOOK(PlayerDied, this);
        }
 }
 
@@ -684,6 +683,48 @@ void PrintToChat(entity player, string text)
        sprint(player, text);
 }
 
+void DebugPrintToChat(entity player, string text)
+{
+       if (autocvar_developer)
+       {
+               PrintToChat(player, text);
+       }
+}
+
+void PrintToChatAll(string text)
+{
+       text = strcat("\{1}^7", text, "\n");
+       bprint(text);
+}
+
+void DebugPrintToChatAll(string text)
+{
+       if (autocvar_developer)
+       {
+               PrintToChatAll(text);
+       }
+}
+
+void PrintToChatTeam(int teamnum, string text)
+{
+       text = strcat("\{1}^7", text, "\n");
+       FOREACH_CLIENT(IS_REAL_CLIENT(it),
+       {
+               if (it.team == teamnum)
+               {
+                       sprint(it, text);
+               }
+       });
+}
+
+void DebugPrintToChatTeam(int teamnum, string text)
+{
+       if (autocvar_developer)
+       {
+               PrintToChatTeam(teamnum, text);
+       }
+}
+
 /**
  * message "": do not say, just test flood control
  * return value: