]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
remove "#" escape in kill messages; now we use standard "%s". Can also reorder args...
authorRudolf Polzer <divverent@alientrap.org>
Fri, 17 Sep 2010 22:45:41 +0000 (00:45 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 17 Sep 2010 22:45:41 +0000 (00:45 +0200)
qcsrc/client/hud.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_triggers.qc

index db423eb8718a10686b9962c78c0ce285d004438f..a4eefeaf9f05fbd1b467c664e73c6015e5e880db 100644 (file)
@@ -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)
index 45962bee7b3e69cb94513c8b57eccb36ba225446..7108fd3dbea18530d278c237c753405fe912db39 100644 (file)
@@ -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) {
index c13fb91186aec2c7bc944716da70b35b0e0e2eed..08964655d9b048faf1d0e696323dbe303c805e5d 100644 (file)
@@ -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;