From 3f1a6657dfa798d111132eb22a991d131c8739f8 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Thu, 13 Dec 2012 00:15:08 -0500 Subject: [PATCH] Foobar --- qcsrc/common/notifications.qc | 10 +++++++--- qcsrc/common/teams.qh | 8 ++++++++ qcsrc/server/cl_player.qc | 2 -- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index f6682509b..a0bf56538 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -41,7 +41,7 @@ string got_commandkey; #define FRAG_PING ((f2 != BOT_PING) ? sprintf(CCR(_("\n(Ping ^2%d^BG)")), f2) : "") #define FRAG_STATS sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), f1, f2, ((f3 != BOT_PING) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f3) : "")) //#define FRAG_POS ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : "") -#define DEATH_TEAM Team_ColoredFullName(f1) +#define DEATH_TEAM Team_ColoredFullName(TEAM_SV_TO_CL(f1)) // NO_CPID normally has a variable value, so we need to check and see // whether a notification uses it. If so, cancel out the centerprint ID. @@ -54,6 +54,8 @@ string got_commandkey; // allow sending of notifications to also pass through to spectators (specifically for centerprints) #ifdef SVQC +#define DEATH_TEAM Team_ColoredFullName(f1) + #define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname #define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement) #define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0 @@ -212,9 +214,9 @@ float Form_Score_Pos(entity player) MSG_DEATH_NOTIF(DEATH_SELF_BETRAYAL, 0, 0, NO_STR_ARG, NO_CPID, _("^K1Don't shoot your team mates!"), _("^K1Don't go against your team mates!"), \ NO_STR_ARG, XPND2("", ""), "", _("^FG%s^K1\n"), "") \ MSG_DEATH_NOTIF(DEATH_SELF_TEAMCHANGE, 1, 1, DEATH_TEAM, NO_CPID, _("^BGYou are now on: %s"), "", \ - s1, XPND2("", ""), "", _("^FG%s^K1 moved to another team\n"), "") \ + XPND2(s1, DEATH_TEAM), XPND2("", ""), "", _("^FG%s^K1 switched to the %s\n"), "") \ MSG_DEATH_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, 1, 1, DEATH_TEAM, NO_CPID, _("^BGYou have been moved into a different team\nYou are now on: %s"), "", \ - s1, XPND2("", ""), "", _("^FG%s^K1 automatically moved to another team\n"), "") \ + XPND2(s1, DEATH_TEAM), XPND2("", ""), "", _("^FG%s^K1 was moved into the %s\n"), "") \ MSG_DEATH_NOTIF(DEATH_SELF_FALL, 0, 0, NO_STR_ARG, NO_CPID, _("^K1You hit the ground with a crunch!"), "", \ NO_STR_ARG, XPND2("", ""), "notify_fall", _("^FG%s^K1 hit the ground with a crunch\n"), _("^FG%s^K1 hit the ground with a bit too much force\n")) \ MSG_DEATH_NOTIF(DEATH_SELF_DROWN, 1, 0, NO_STR_ARG, NO_CPID, _("^K1You couldn't catch your breath in time!"), "", \ @@ -540,6 +542,8 @@ void Local_Notification(float net_type, float net_name, string s1, string s2, fl { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \ { \ centerprint_generic(HANDLE_CPID(cpid), sprintf(CCR(normal_or_gentle(cennor, cengen)), args), 0, 0); \ + print(sprintf(CCR(normal_or_gentle(infnor, infgen)), infargs)); \ + if(strtolower(icon) != "") { HUD_Notify_Push(icon, hudargs); } \ } } MSG_DEATH_NOTIFICATIONS #undef MSG_DEATH_NOTIF diff --git a/qcsrc/common/teams.qh b/qcsrc/common/teams.qh index 00500a161..95f8f2006 100644 --- a/qcsrc/common/teams.qh +++ b/qcsrc/common/teams.qh @@ -4,6 +4,10 @@ const float FL_TEAM_2 = 2; // blue const float FL_TEAM_3 = 3; // yellow const float FL_TEAM_4 = 4; // pink const float FL_SPECTATOR = 5; + +// TO BE PHASED OUT IF WE SWITCH TO USE "TEAMNUMBERS_THAT_ARENT_STUPID" +#define TEAM_SV_TO_CL(num) num +#define TEAM_CL_TO_SV(num) num #else #ifdef CSQC const float FL_TEAM_1 = 4; // red @@ -17,6 +21,10 @@ const float FL_TEAM_3 = 13; // yellow const float FL_TEAM_4 = 10; // pink #endif const float FL_SPECTATOR = 1337; + +// TO BE PHASED OUT IF WE SWITCH TO USE "TEAMNUMBERS_THAT_ARENT_STUPID" +#define TEAM_SV_TO_CL(num) (num - 1) +#define TEAM_CL_TO_SV(num) (num + 1) #endif const string COL_TEAM_1 = "^1"; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 3f5ad0b49..b019629a3 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1419,6 +1419,4 @@ void MoveToTeam(entity client, float team_colour, float type) lockteams = lockteams_backup; // restore the team lock LogTeamchange(client.playerid, client.team, type); - - bprint(strcat(client.netname, " joined the ", Team_ColoredFullName(client.team), "\n")); } -- 2.39.2