]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove more usage of legacy wrapper
authorSamual Lenks <samual@xonotic.org>
Sat, 16 Feb 2013 19:37:45 +0000 (14:37 -0500)
committerSamual Lenks <samual@xonotic.org>
Sat, 16 Feb 2013 19:37:45 +0000 (14:37 -0500)
qcsrc/common/notifications.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_ctf.qc

index eac793afb61fec7f5ebe10022687bca0826b434d..340ee5c68f4dccc4dc518f7daec1e09d1af120ed 100644 (file)
@@ -437,11 +437,10 @@ void Send_Notification_Without_VarArgs(float broadcast, entity client,
        float stringcount, float floatcount,
        string s1, string s2, string s3, string s4,
        float f1, float f2, float f3, float f4)
-{              
+{
        #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Send_Notification(broadcast, client, net_type, net_name, args); return; }
        EIGHT_VARS_TO_VARARGS_VARLIST
        #undef VARITEM
-
        Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
 }
 
index fbad5d596ff4bb91d4d122acb8e7287037584b29..4f1e960b1872432366ff8bc218e7bd65ef4863ba 100644 (file)
@@ -488,38 +488,54 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
                        {
                                if(targ.istypefrag)
                                {
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE : DEATH_MURDER_TYPEFRAG_FIRST),
-                                               s2, s1, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : 0), 0, 0);
-                                               
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE : DEATH_MURDER_TYPEFRAGGED_FIRST),
-                                               s1, "", (targ.FRAG_VERBOSE ? attacker.health : 0), (targ.FRAG_VERBOSE ? attacker.armorvalue : 0), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : 0));
+                                       if(attacker.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE, s2, s1, ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_TYPEFRAG_FIRST, s2, s1);
+
+                                       if(targ.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE, s1, attacker.health, attacker.armorvalue, ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_TYPEFRAGGED_FIRST, s1);
                                }
                                else
                                {
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_FRAG_FIRST_VERBOSE : DEATH_MURDER_FRAG_FIRST),
-                                               s2, s1, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : 0), 0, 0);
-                                               
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_FRAGGED_FIRST_VERBOSE : DEATH_MURDER_FRAGGED_FIRST),
-                                               s1, "", (targ.FRAG_VERBOSE ? attacker.health : 0), (targ.FRAG_VERBOSE ? attacker.armorvalue : 0), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : 0));
+                                       if(attacker.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_FRAG_FIRST_VERBOSE, s2, s1, ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_FRAG_FIRST, s2, s1);
+
+                                       if(targ.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_FRAGGED_FIRST_VERBOSE, s1, attacker.health, attacker.armorvalue, ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_FRAGGED_FIRST, s1);
                                }
                        }
                        else // normal frags, kill sprees listed
                        {
                                if(targ.istypefrag)
                                {
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAG_VERBOSE : DEATH_MURDER_TYPEFRAG),
-                                               s2, "", attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : 0), 0);
-                                               
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAGGED_VERBOSE : DEATH_MURDER_TYPEFRAGGED),
-                                               s1, "", (targ.FRAG_VERBOSE ? attacker.health : 0), (targ.FRAG_VERBOSE ? attacker.armorvalue : 0), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : 0));
+                                       if(attacker.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_TYPEFRAG_VERBOSE, s2, attacker.killcount, ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_TYPEFRAG, s2, attacker.killcount);
+
+                                       if(targ.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_TYPEFRAGGED_VERBOSE, s1, attacker.health, attacker.armorvalue, ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_TYPEFRAGGED, s1);
                                }
                                else
                                {
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_FRAG_VERBOSE : DEATH_MURDER_FRAG),
-                                               s2, "", attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : 0), 0);
-                                               
-                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_FRAGGED_VERBOSE : DEATH_MURDER_FRAGGED),
-                                               s1, "", (targ.FRAG_VERBOSE ? attacker.health : 0), (targ.FRAG_VERBOSE ? attacker.armorvalue : 0), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : 0));
+                                       if(attacker.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_FRAG_VERBOSE, s2, attacker.killcount, ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_MURDER_FRAG, s2, attacker.killcount);
+
+                                       if(targ.FRAG_VERBOSE)
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_FRAGGED_VERBOSE, s1, attacker.health, attacker.armorvalue, ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping));
+                                       else
+                                               Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_MURDER_FRAGGED, s1);
                                }
                        }
 
index 105aae7dd5aaba054c61fe8881877aebb4285edc..0ab8c7f9c9c673fe07e43f62c5f3de389f2c0576 100644 (file)
@@ -507,9 +507,19 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype)
                        if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); }
                }
                else if(!IsDifferentTeam(tmp_player, player) && tmp_player != player)
-                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, (tmp_player.PICKUP_TEAM_VERBOSE ? CENTER_CTF_PICKUP_TEAM_VERBOSE : CENTER_CTF_PICKUP_TEAM), Team_ColorCode(player.team), (tmp_player.PICKUP_TEAM_VERBOSE ? player.netname : ""), 0, 0, 0);
+               {
+                       if(tmp_player.PICKUP_TEAM_VERBOSE)
+                               Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, CENTER_CTF_PICKUP_TEAM_VERBOSE, Team_ColorCode(player.team), player.netname);
+                       else
+                               Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, CENTER_CTF_PICKUP_TEAM, Team_ColorCode(player.team));
+               }
                else if(IsDifferentTeam(tmp_player, player))
-                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, (tmp_player.PICKUP_ENEMY_VERBOSE ? CENTER_CTF_PICKUP_ENEMY_VERBOSE : CENTER_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), (tmp_player.PICKUP_ENEMY_VERBOSE ? player.netname : ""), 0, 0, 0);
+               {
+                       if(tmp_player.PICKUP_ENEMY_VERBOSE)
+                               Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY_VERBOSE, Team_ColorCode(player.team), player.netname);
+                       else
+                               Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY, Team_ColorCode(player.team));
+               }
        }
        
        // scoring