]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
damagetext: put insta inside macro, update description
authorMartin Taibr <taibr.martin@gmail.com>
Thu, 10 Aug 2017 22:14:24 +0000 (00:14 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Thu, 10 Aug 2017 22:14:24 +0000 (00:14 +0200)
qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc

index 7e96086426fa5a46ad1069d42f5e6bc3e2484fc1..4a18cc930879ad34e28ef7551c7af1e381bf8d46 100644 (file)
@@ -1,15 +1,15 @@
 #include "sv_damagetext.qh"
 
-AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: spectators, >= 2: players, >= 3: all players");
+AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage");
 
 REGISTER_MUTATOR(damagetext, true);
 
-#define SV_DAMAGETEXT_DISABLED()        (autocvar_sv_damagetext <= 0 /* disabled */)
-#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1 /* spectators only */)
-#define SV_DAMAGETEXT_PLAYERS()         (autocvar_sv_damagetext >= 2 /* players */)
-#define SV_DAMAGETEXT_ALL()             (autocvar_sv_damagetext >= 3 /* all players */)
+#define SV_DAMAGETEXT_DISABLED()        (autocvar_sv_damagetext <= 0 || autocvar_g_instagib)
+#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1)
+#define SV_DAMAGETEXT_PLAYERS()         (autocvar_sv_damagetext >= 2)
+#define SV_DAMAGETEXT_ALL()             (autocvar_sv_damagetext >= 3)
 MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
-    if (SV_DAMAGETEXT_DISABLED() || autocvar_g_instagib) return;
+    if (SV_DAMAGETEXT_DISABLED()) return;
     const entity attacker = M_ARGV(0, entity);
     const entity hit = M_ARGV(1, entity); if (hit == attacker) return;
     const float health = M_ARGV(2, float);