From 48cf18619386a4dc90ec41fdd99933672f36de7e Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sat, 16 Feb 2013 14:37:45 -0500 Subject: [PATCH] Remove more usage of legacy wrapper --- qcsrc/common/notifications.qc | 3 +- qcsrc/server/g_damage.qc | 56 +++++++++++++++++---------- qcsrc/server/mutators/gamemode_ctf.qc | 14 ++++++- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index eac793afb..340ee5c68 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -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 } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index fbad5d596..4f1e960b1 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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); } } diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 105aae7dd..0ab8c7f9c 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -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 -- 2.39.2