From: Samual Lenks Date: Sat, 16 Feb 2013 15:54:51 +0000 (-0500) Subject: Get rid of NO_FL_ARG and strip out a lot of usage of the legacy wrapper X-Git-Tag: xonotic-v0.7.0~62^2~23^2~209 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=403ee70400305be21f798bbc39f83c0ea12b415a;p=xonotic%2Fxonotic-data.pk3dir.git Get rid of NO_FL_ARG and strip out a lot of usage of the legacy wrapper --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 8a84f26ed..eac793afb 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -215,10 +215,10 @@ void Local_Notification(float net_type, float net_name, ...count) string s2 = ((1 < notif.nent_stringcount) ? ...(1, string) : ""); string s3 = ((2 < notif.nent_stringcount) ? ...(2, string) : ""); string s4 = ((3 < notif.nent_stringcount) ? ...(3, string) : ""); - float f1 = ((notif.nent_stringcount < count) ? ...(notif.nent_stringcount, float) : NO_FL_ARG); - float f2 = (((notif.nent_stringcount + 1) < count) ? ...((notif.nent_stringcount + 1), float) : NO_FL_ARG); - float f3 = (((notif.nent_stringcount + 2) < count) ? ...((notif.nent_stringcount + 2), float) : NO_FL_ARG); - float f4 = (((notif.nent_stringcount + 3) < count) ? ...((notif.nent_stringcount + 3), float) : NO_FL_ARG); + float f1 = ((notif.nent_stringcount < count) ? ...(notif.nent_stringcount, float) : 0); + float f2 = (((notif.nent_stringcount + 1) < count) ? ...((notif.nent_stringcount + 1), float) : 0); + float f3 = (((notif.nent_stringcount + 2) < count) ? ...((notif.nent_stringcount + 2), float) : 0); + float f4 = (((notif.nent_stringcount + 3) < count) ? ...((notif.nent_stringcount + 3), float) : 0); #ifdef NOTIFICATIONS_DEBUG dprint(sprintf("Local_Notification(%d, %s, %s, %s);\n", @@ -306,10 +306,10 @@ void Read_Notification(float is_new) string s2 = ((1 < notif.nent_stringcount) ? ReadString() : ""); string s3 = ((2 < notif.nent_stringcount) ? ReadString() : ""); string s4 = ((3 < notif.nent_stringcount) ? ReadString() : ""); - float f1 = ((0 < notif.nent_floatcount) ? ReadLong() : NO_FL_ARG); - float f2 = ((1 < notif.nent_floatcount) ? ReadLong() : NO_FL_ARG); - float f3 = ((2 < notif.nent_floatcount) ? ReadLong() : NO_FL_ARG); - float f4 = ((3 < notif.nent_floatcount) ? ReadLong() : NO_FL_ARG); + float f1 = ((0 < notif.nent_floatcount) ? ReadLong() : 0); + float f2 = ((1 < notif.nent_floatcount) ? ReadLong() : 0); + float f3 = ((2 < notif.nent_floatcount) ? ReadLong() : 0); + float f4 = ((3 < notif.nent_floatcount) ? ReadLong() : 0); #ifdef NOTIFICATIONS_DEBUG dprint(sprintf("Read_Notification(%d) at %f: net_name = %s.\n", is_new, time, notif.nent_name)); @@ -452,7 +452,7 @@ void Send_Notification_Legacy_Wrapper(float broadcast, entity client, { float stringcount = Get_Notif_Strnum(net_type, net_name); float floatcount = Get_Notif_Flnum(net_type, net_name); - Send_Notification_Without_VarArgs(broadcast, client, net_type, net_name, stringcount, floatcount, s1, s2, "", "", f1, f2, f3, NO_FL_ARG); + Send_Notification_Without_VarArgs(broadcast, client, net_type, net_name, stringcount, floatcount, s1, s2, "", "", f1, f2, f3, 0); } diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 2bdae415b..77810a83b 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -10,9 +10,7 @@ #define MSG_DEATH 4 // "Personal" AND "Global" death messages #ifndef MENUQC // SERVER AND CLIENT ONLY -// notification system nullified arguments -#define NO_FL_ARG -12345 -#define NO_MSG -12345 +#define NO_MSG -12345 // ping of bots defined for extra frag message notification information #define BOT_PING -1 @@ -107,7 +105,7 @@ void Read_Notification(float is_new); #define NOTIF_ANY_EXCEPT 6 #define IFSTR(num) ((num < notif.nent_stringcount) ? ...(num, string) : "") -#define IFFL(num) ((((notif.nent_stringcount-1) + num) < count) ? ...(((notif.nent_stringcount-1) + num), float) : NO_FL_ARG) +#define IFFL(num) ((((notif.nent_stringcount-1) + num) < count) ? ...(((notif.nent_stringcount-1) + num), float) : 0) void Send_Notification(float broadcast, entity client, float net_type, float net_name, ...count); void Send_Notification_Without_VarArgs(float broadcast, entity client, float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4); diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index fa25ade7d..c6ef0e33e 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -361,8 +361,6 @@ void queue_to_execute_next_frame(string s); // for marking written-to values as unused where it's a good idea to do this noref float unused_float; - - // a function f with: // f(0) = 0 // f(1) = 1 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 7e89fd7df..d12a704de 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -426,10 +426,10 @@ void PutObserverInServer (void) if(self.killcount != -666) { if(g_lms) { if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0 && self.lms_spectate_warning != 2) - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_LMS_NOLIVES, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_LMS_NOLIVES, self.netname); else - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - } else { Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_SPECTATE, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname); + } else { Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_SPECTATE, self.netname); } if(self.just_joined == FALSE) { LogTeamchange(self.playerid, -1, 4); @@ -695,7 +695,7 @@ void PutClientInServer (void) spot = SelectSpawnPoint (FALSE); if(!spot) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_NOSPAWNS, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_NOSPAWNS); return; // spawn failed } @@ -877,9 +877,9 @@ void PutClientInServer (void) if(g_assault) { if(self.team == assault_attacker_team) - Send_Notification_Legacy_Wrapper(NOTIF_TEAM, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_TEAM, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING); else - Send_Notification_Legacy_Wrapper(NOTIF_TEAM, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_TEAM, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING); } target_voicescript_clear(self); @@ -1082,7 +1082,7 @@ void ClientKill_Now_TeamChange() if(g_ca) self.caplayer = 0; if(blockSpectators) - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, "", "", autocvar_g_maxplayers_spectator_blocktime, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime); PutObserverInServer(); } else @@ -1233,28 +1233,28 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 self.killindicator.colormod = '0 0 0'; if(clienttype(self) == CLIENTTYPE_REAL) if(self.killindicator.cnt > 0) - Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SUICIDE, "", "", self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SUICIDE, self.killindicator.cnt); } else if(targetteam == -1) // auto { self.killindicator.colormod = '0 1 0'; if(clienttype(self) == CLIENTTYPE_REAL) if(self.killindicator.cnt > 0) - Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_AUTO, "", "", self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_AUTO, self.killindicator.cnt); } else if(targetteam == -2) // spectate { self.killindicator.colormod = '0.5 0.5 0.5'; if(clienttype(self) == CLIENTTYPE_REAL) if(self.killindicator.cnt > 0) - Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SPECTATE, "", "", self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SPECTATE, self.killindicator.cnt); } else { self.killindicator.colormod = Team_ColorRGB(targetteam); if(clienttype(self) == CLIENTTYPE_REAL) if(self.killindicator.cnt > 0) - Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, APP_TEAM_NUM_4(targetteam, CENTER_TEAMCHANGE_), "", "", self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, APP_TEAM_NUM_4(targetteam, CENTER_TEAMCHANGE_), self.killindicator.cnt); } } @@ -1483,9 +1483,9 @@ void ClientConnect (void) self.netname_previous = strzone(self.netname); if((self.classname == STR_PLAYER && teamplay)) - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(self, INFO_JOIN_CONNECT_TEAM_), self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(self, INFO_JOIN_CONNECT_TEAM_), self.netname); else - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_JOIN_CONNECT, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_JOIN_CONNECT, self.netname); stuffcmd(self, strcat(clientstuff, "\n")); stuffcmd(self, "cl_particles_reloadeffects\n"); // TODO do we still need this? @@ -1528,7 +1528,7 @@ void ClientConnect (void) self.spectatortime = time; if(blockSpectators) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, "", "", autocvar_g_maxplayers_spectator_blocktime, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime); } self.jointime = time; @@ -1642,7 +1642,7 @@ void ClientDisconnect (void) if(autocvar_sv_eventlog) GameLogEcho(strcat(":part:", ftos(self.playerid))); - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname); DropAllRunes(self); MUTATOR_CALLHOOK(ClientDisconnect); @@ -1813,7 +1813,7 @@ void player_powerups (void) self.alpha = default_player_alpha; self.exteriorweaponentity.alpha = default_weapon_alpha; self.items &~= IT_STRENGTH; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_INVISIBILITY, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_INVISIBILITY); } } else @@ -1823,7 +1823,7 @@ void player_powerups (void) self.alpha = g_minstagib_invis_alpha; self.exteriorweaponentity.alpha = g_minstagib_invis_alpha; self.items |= IT_STRENGTH; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_INVISIBILITY, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_INVISIBILITY); } } @@ -1833,7 +1833,7 @@ void player_powerups (void) if (time > self.invincible_finished) { self.items = self.items - (self.items & IT_INVINCIBLE); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_SPEED, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_SPEED); } } else @@ -1841,7 +1841,7 @@ void player_powerups (void) if (time < self.invincible_finished) { self.items = self.items | IT_INVINCIBLE; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_SPEED, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_SPEED); } } } @@ -1854,7 +1854,7 @@ void player_powerups (void) if (time > self.strength_finished) { self.items = self.items - (self.items & IT_STRENGTH); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_STRENGTH, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_STRENGTH); } } else @@ -1862,7 +1862,7 @@ void player_powerups (void) if (time < self.strength_finished) { self.items = self.items | IT_STRENGTH; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_STRENGTH, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_STRENGTH); } } if (self.items & IT_INVINCIBLE) @@ -1872,7 +1872,7 @@ void player_powerups (void) if (time > self.invincible_finished) { self.items = self.items - (self.items & IT_INVINCIBLE); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_SHIELD, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_SHIELD); } } else @@ -1880,7 +1880,7 @@ void player_powerups (void) if (time < self.invincible_finished) { self.items = self.items | IT_INVINCIBLE; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_SHIELD, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_SHIELD); } } if (self.items & IT_SUPERWEAPON) @@ -1889,7 +1889,7 @@ void player_powerups (void) { self.superweapons_finished = 0; self.items = self.items - (self.items & IT_SUPERWEAPON); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_LOST, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_LOST); } else if (self.items & IT_UNLIMITED_SUPERWEAPONS) { @@ -1902,7 +1902,7 @@ void player_powerups (void) { self.items = self.items - (self.items & IT_SUPERWEAPON); WEPSET_ANDNOT_EA(self, WEPBIT_SUPERWEAPONS); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_BROKEN, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_BROKEN); } } } @@ -1911,7 +1911,7 @@ void player_powerups (void) if (time < self.superweapons_finished || (self.items & IT_UNLIMITED_SUPERWEAPONS)) { self.items = self.items | IT_SUPERWEAPON; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_PICKUP, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_PICKUP); } else { @@ -2333,7 +2333,7 @@ void LeaveSpectatorMode() PutClientInServer(); if(self.classname == STR_PLAYER) - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_JOIN_PLAY, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_JOIN_PLAY, self.netname); if(!autocvar_g_campaign) if (time < self.jointime + autocvar_welcome_message_time) @@ -2341,7 +2341,7 @@ void LeaveSpectatorMode() if (self.prevent_join_msgtime) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT); self.prevent_join_msgtime = 0; } @@ -2411,7 +2411,7 @@ float nJoinAllowed(entity ignore) { void checkSpectatorBlock() { if(self.classname == "spectator" || self.classname == "observer") { if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING); dropclient(self); } } @@ -2598,7 +2598,7 @@ void PlayerPreThink (void) { // notify release users if connecting to git dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"); - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, self.cvar_g_xonoticversion, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, self.cvar_g_xonoticversion); } else { @@ -2608,13 +2608,13 @@ void PlayerPreThink (void) { // give users new version dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n"); - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, self.cvar_g_xonoticversion, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, self.cvar_g_xonoticversion); } else if(r > 0) { // notify users about old server version print("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"); - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, self.cvar_g_xonoticversion, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, self.cvar_g_xonoticversion); } } } @@ -2624,7 +2624,7 @@ void PlayerPreThink (void) // GOD MODE info if(!(self.flags & FL_GODMODE)) if(self.max_armorvalue) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_GODMODE_OFF, "", "", self.max_armorvalue, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_GODMODE_OFF, self.max_armorvalue); self.max_armorvalue = 0; } @@ -2780,7 +2780,7 @@ void PlayerPreThink (void) //sprint(self, "distance: ", ftos(self.lms_traveled_distance), "\n"); if(self.lms_traveled_distance < autocvar_g_lms_campcheck_distance) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_CENTER, CENTER_LMS_CAMPCHECK, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_LMS_CAMPCHECK); // FIXME KadaverJack: gibbing player here causes playermodel to bounce around, instead of eye.md3 // I wasn't able to find out WHY that happens, so I put a workaround in place that shall prevent players from being gibbed :( Damage(self, self, self, bound(0, autocvar_g_lms_campcheck_damage, self.health + self.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP, self.origin, '0 0 0'); @@ -2988,11 +2988,11 @@ void PlayerPostThink (void) if(timeleft == min(10, sv_maxidle - 1)) // - 1 to support sv_maxidle <= 10 { if(!self.idlekick_lasttimeleft) - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_DISCONNECT_IDLING, "", "", timeleft, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft); } if(timeleft <= 0) { - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_KICK_IDLING, self.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_KICK_IDLING, self.netname); dropclient(self); return; } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 5f640ca51..b47197fe0 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1108,7 +1108,7 @@ void GameCommand_nospectators(float request) if(plr.classname == "spectator" || plr.classname == "observer") { plr.spectatortime = time; - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, "", "", autocvar_g_maxplayers_spectator_blocktime, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime); } } bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n")); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index c1ebc1efa..fbad5d596 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -354,8 +354,8 @@ float Obituary_WeaponDeath(entity notif_target, float murder, float deathtype, s if(death_message) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_WEAPON, death_message, s1, s2, f1, NO_FL_ARG, NO_FL_ARG); - Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, Get_Notif_Infval(MSG_WEAPON, death_message), s1, s2, f1, NO_FL_ARG, NO_FL_ARG); + Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_WEAPON, death_message, s1, s2, f1, 0, 0); + Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, Get_Notif_Infval(MSG_WEAPON, death_message), s1, s2, f1, 0, 0); //print(Get_Field_Value(F_INFVAL, MSG_WEAPON, death_message), "\n"); } else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); } @@ -373,7 +373,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) // Declarations string s1 = "", s2 = ""; - float f1 = NO_FL_ARG, f2 = NO_FL_ARG, f3 = NO_FL_ARG; + float f1 = 0, f2 = 0, f3 = 0; float notif_firstblood = FALSE; //dprint(sprintf("Obituary(): Deathtype = %s (%d), Attacker = %s, Inflictor = %s, Target = %s...\n", Deathtype_Name(deathtype), deathtype, attacker.netname, inflictor.netname, targ.netname)); @@ -406,7 +406,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) s1 = targ.netname; f1 = targ.killcount; s2 = ""; - f2 = f3 = NO_FL_ARG; + f2 = f3 = 0; break; } } @@ -414,7 +414,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) GiveFrags(attacker, targ, -1, deathtype); } - Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, NO_FL_ARG); + Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, 0); } else if not(Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, "", targ.killcount)) { @@ -441,9 +441,9 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) attacker.killcount = 0; - Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, DEATH_TEAMKILL_FRAG, s2, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, DEATH_TEAMKILL_FRAGGED, s1, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, attacker, MSG_DEATH, DEATH_TEAMKILL_FRAG, s2); + Send_Notification(NOTIF_ONE, targ, MSG_DEATH, DEATH_TEAMKILL_FRAGGED, s1); + Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), s2, s1, targ.killcount); // In this case, the death message will ALWAYS be "foo was betrayed by bar" // No need for specific death/weapon messages... @@ -489,18 +489,18 @@ 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) : NO_FL_ARG), NO_FL_ARG, NO_FL_ARG); + 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 : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG)); + 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)); } 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) : NO_FL_ARG), NO_FL_ARG, NO_FL_ARG); + 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 : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG)); + 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)); } } else // normal frags, kill sprees listed @@ -508,24 +508,24 @@ 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_VERBOSE : DEATH_MURDER_TYPEFRAG), - s2, "", attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG); + 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 : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG)); + 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)); } 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) : NO_FL_ARG), NO_FL_ARG); + 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 : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG)); + 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)); } } //print("targ_killcount = ", ftos(targ.killcount), ", attacker_killcount = ", ftos(attacker.killcount), ".\n"); if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, targ.killcount)) - Obituary_SpecialDeath(targ, TRUE, deathtype, s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG); + Obituary_SpecialDeath(targ, TRUE, deathtype, s2, s1, targ.killcount, 0, 0); } } @@ -553,7 +553,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) s2 = deathmessage; f1 = targ.killcount; if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); } - f2 = f3 = NO_FL_ARG; + f2 = f3 = 0; break; } @@ -562,7 +562,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) s1 = targ.netname; f1 = targ.killcount; s2 = ""; - f2 = f3 = NO_FL_ARG; + f2 = f3 = 0; break; } } diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 2cdb6b087..fea9734fd 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -26,7 +26,7 @@ void ctf_CaptureRecord(entity flag, entity player) float notification, success; float cap_record = ctf_captimerecord; float cap_time = (time - flag.ctf_pickuptime); - float f1, f2 = NO_FL_ARG; + float f1, f2 = 0; string s1, s2 = ""; string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname")); @@ -41,13 +41,13 @@ void ctf_CaptureRecord(entity flag, entity player) // notify about shit FOR_EACH_REALCLIENT(tmp_entity) { - if not(tmp_entity.CAPTURE_VERBOSE) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = ""; f1 = f2 = NO_FL_ARG; } - Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, notification, s1, s2, f1, f2, NO_FL_ARG); + if not(tmp_entity.CAPTURE_VERBOSE) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = ""; f1 = f2 = 0; } + Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, notification, s1, s2, f1, f2, 0); } // notify server log too - if not(autocvar_notification_ctf_capture_verbose) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = ""; f1 = f2 = NO_FL_ARG; } - Local_Notification_Without_VarArgs(MSG_INFO, notification, Get_Notif_Strnum(MSG_INFO, notification), Get_Notif_Flnum(MSG_INFO, notification), s1, s2, "", "", f1, f2, NO_FL_ARG, NO_FL_ARG); + if not(autocvar_notification_ctf_capture_verbose) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = ""; f1 = f2 = 0; } + Local_Notification_Without_VarArgs(MSG_INFO, notification, Get_Notif_Strnum(MSG_INFO, notification), Get_Notif_Flnum(MSG_INFO, notification), s1, s2, "", "", f1, f2, 0, 0); // write that shit in the database if(success) @@ -172,11 +172,7 @@ void ctf_CaptureShield_Update(entity player, float wanted_status) float updated_status = ctf_CaptureShield_CheckStatus(player); if((wanted_status == player.ctf_captureshielded) && (updated_status != wanted_status)) // 0: shield only, 1: unshield only { - if(updated_status) // TODO csqc notifier for this // Samual: How? - Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - else - Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_FREE, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - + Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((updated_status) ? CENTER_CTF_CAPTURESHIELD_SHIELDED : CENTER_CTF_CAPTURESHIELD_FREE)); player.ctf_captureshielded = updated_status; } } @@ -198,7 +194,7 @@ void ctf_CaptureShield_Touch() vector othermid = (other.absmin + other.absmax) * 0.5; Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ctf_captureshield_force); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED); } void ctf_CaptureShield_Spawn(entity flag) @@ -241,7 +237,7 @@ void ctf_Handle_Drop(entity flag, entity player, float droptype) flag.ctf_status = FLAG_DROPPED; // messages and sounds - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname); sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTN_NONE); ctf_EventLog("dropped", player.team, player); @@ -294,11 +290,11 @@ void ctf_Handle_Retrieve(entity flag, entity player) FOR_EACH_REALPLAYER(tmp_player) { if(tmp_player == sender) - Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_SENT_), player.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_SENT_), player.netname); else if(tmp_player == player) - Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_RECEIVED_), sender.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_RECEIVED_), sender.netname); else if(!IsDifferentTeam(tmp_player, sender)) - Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_OTHER_), sender.netname, player.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_OTHER_), sender.netname, player.netname); } // create new waypoint @@ -452,8 +448,8 @@ void ctf_Handle_Capture(entity flag, entity toucher, float capturetype) void ctf_Handle_Return(entity flag, entity player) { // messages and sounds - Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_)); + Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname); sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE); ctf_EventLog("return", flag.team, player); @@ -501,20 +497,20 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype) } // messages and sounds - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname); sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE); FOR_EACH_REALPLAYER(tmp_player) { if(tmp_player == player) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - if(ctf_stalemate) { Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } + Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_)); + 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 : ""), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + 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); 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 : ""), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + 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); } // scoring @@ -573,14 +569,14 @@ void ctf_CheckFlagReturn(entity flag, float returntype) { switch(returntype) { - case RETURN_DROPPED: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DROPPED_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break; - case RETURN_DAMAGE: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DAMAGED_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break; - case RETURN_SPEEDRUN: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_SPEEDRUN_), "", "", ctf_captimerecord, NO_FL_ARG, NO_FL_ARG); break; - case RETURN_NEEDKILL: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_NEEDKILL_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break; + case RETURN_DROPPED: Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DROPPED_)); break; + case RETURN_DAMAGE: Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DAMAGED_)); break; + case RETURN_SPEEDRUN: Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_SPEEDRUN_), ctf_captimerecord); break; + case RETURN_NEEDKILL: Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_NEEDKILL_)); break; default: case RETURN_TIMEOUT: - { Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break; } + { Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_)); break; } } sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTN_NONE); ctf_EventLog("returned", flag.team, world); @@ -634,10 +630,7 @@ void ctf_CheckStalemate(void) if not(wpforenemy_announced) { FOR_EACH_REALPLAYER(tmp_entity) - if(tmp_entity.flagcarried) - Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_entity, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - else - Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_entity, MSG_CENTER, CENTER_CTF_STALEMATE_OTHER, "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, tmp_entity, MSG_CENTER, ((tmp_entity.flagcarried) ? CENTER_CTF_STALEMATE_CARRIER : CENTER_CTF_STALEMATE_OTHER)); wpforenemy_announced = TRUE; } @@ -1848,13 +1841,13 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) { if(clienttype(head) == CLIENTTYPE_BOT) { - Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname); ctf_Handle_Throw(head, player, DROP_PASS); } else { - Send_Notification_Legacy_Wrapper(NOTIF_ONE, head, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); - Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, head, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname); + Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname); } player.throw_antispam = time + autocvar_g_ctf_pass_wait; return TRUE; @@ -1891,7 +1884,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) } else { - Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_FLAG_THROW_PUNISH, "", "", rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time), NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_FLAG_THROW_PUNISH, rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time)); return FALSE; } } @@ -1966,7 +1959,7 @@ MUTATOR_HOOKFUNCTION(ctf_AbortSpeedrun) { if(self.flagcarried) { - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(self.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN_), "", "", NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(self.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN_)); ctf_RespawnFlag(self.flagcarried); return TRUE; } diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 4b32c6af6..9c2874ad3 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -156,13 +156,13 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - oldrec), "]"); bprint(mynetname, "^7 couldn't break their ", race_placeName(player_prevpos), " place record of ", TIME_ENCODED_TOSTRING(oldrec), recorddifference, "\n"); race_SendStatus(0, e); // "fail" - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t)); return; } else if (!newpos) { // no ranking, time worse than the worst ranked recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - race_readTime(GetMapname(), RANKINGS_CNT)), "]"); bprint(mynetname, "^7 couldn't break the ", race_placeName(RANKINGS_CNT), " place record of ", TIME_ENCODED_TOSTRING(race_readTime(GetMapname(), RANKINGS_CNT)), recorddifference, "\n"); race_SendStatus(0, e); // "fail" - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t)); return; } @@ -201,22 +201,22 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) bprint(mynetname, "^1 broke ", oldrec_holder, "^1's 1st place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n")); } race_SendStatus(3, e); // "new server record" - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RECORD, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RECORD, e.netname, TIME_ENCODED_TOSTRING(t)); } else { if(newpos == player_prevpos) { recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]"); bprint(mynetname, "^5 improved their ", race_placeName(newpos), " ^5place record with ", TIME_ENCODED_TOSTRING(t), recorddifference, "\n"); race_SendStatus(1, e); // "new time" - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_TIME, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_TIME, e.netname, TIME_ENCODED_TOSTRING(t)); } else if (oldrec == 0) { bprint(mynetname, "^2 set the ", race_placeName(newpos), " ^2place record with ", TIME_ENCODED_TOSTRING(t), "\n"); race_SendStatus(2, e); // "new rank" - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t)); } else { recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]"); bprint(mynetname, "^2 broke ", oldrec_holder, "^2's ", race_placeName(newpos), " ^2place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n")); race_SendStatus(2, e); // "new rank" - Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); + Send_Notification(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t)); } } }