From: Rudolf Polzer Date: Fri, 17 Sep 2010 22:45:41 +0000 (+0200) Subject: remove "#" escape in kill messages; now we use standard "%s". Can also reorder args... X-Git-Tag: xonotic-v0.1.0preview~267^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a7057abe85405a114ef491f30c7334ae8c175463;p=xonotic%2Fxonotic-data.pk3dir.git remove "#" escape in kill messages; now we use standard "%s". Can also reorder args in message2 now, like "%2$s threw %1$s in a world of hurt" --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index db423eb87..a4eefeaf9 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2754,7 +2754,11 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } else if (type == DEATH_CUSTOM) { HUD_KillNotify_Push(s1, s2, 1, DEATH_CUSTOM); if(alsoprint) - print ("^1",s2, "^1 ", s1, "\n"); + print("^1", sprintf(s3, strcat(s2, "^1"), strcat(s1, "^1")), "\n"); + } else if (type == DEATH_HURTTRIGGER) { + HUD_KillNotify_Push(s1, s2, 1, DEATH_HURTTRIGGER); + if(alsoprint) + print("^1", sprintf(s3, strcat(s2, "^1"), strcat(s1, "^1")), "\n"); } else { HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC); if(alsoprint) @@ -2859,11 +2863,11 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } else if (type == DEATH_CUSTOM) { HUD_KillNotify_Push(s1, "", 0, DEATH_CUSTOM); if(alsoprint) - print ("^1",s1, "^1 ", s2, "\n"); + print("^1", sprintf(s2, strcat(s1, "^1")), "\n"); } else if (type == DEATH_HURTTRIGGER) { HUD_KillNotify_Push(s1, "", 0, DEATH_HURTTRIGGER); if(alsoprint) - print ("^1",s1, "^1 was in the wrong place\n"); + print("^1", sprintf(s2, strcat(s1, "^1")), "\n"); } else if(type == DEATH_TOUCHEXPLODE) { HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC); if(alsoprint) diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 45962bee7..7108fd3db 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -364,11 +364,12 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) // TODO: fix this? if (deathtype == DEATH_CUSTOM) - msg = strcat(deathmessage, " by ^1", msg); - else if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "") - { - msg = ftos(strstrofs(inflictor.message2, "#", 0)); - } + msg = deathmessage; + else + msg = inflictor.message2; + + if(strstrofs(msg, "%", 0) < 0) + msg = strcat("%s ", msg, " by %s"); Send_KillNotification(a, s, msg, deathtype, MSG_KILL); @@ -435,6 +436,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) msg = inflictor.message; else if (deathtype == DEATH_CUSTOM) msg = deathmessage; + if(strstrofs(msg, "%", 0) < 0) + msg = strcat("%s ", msg); GiveFrags(targ, targ, -1); if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) { diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index c13fb9118..08964655d 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -462,6 +462,7 @@ void spawnfunc_trigger_hurt() self.message = "was in the wrong place"; if (!self.message2) self.message2 = "was thrown into a world of hurt by"; + // self.message = "someone like %s always gets wrongplaced"; if(!trigger_hurt_first) trigger_hurt_first = self;