From 4a0d1575844cf12b699b891a2cc6e38821f5ccd3 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 28 Jul 2023 20:05:13 +0200 Subject: [PATCH] Optimize a couple checks, sort notifications in all.inc --- qcsrc/common/minigames/sv_minigames.qc | 4 ++-- qcsrc/common/notifications/all.inc | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/minigames/sv_minigames.qc b/qcsrc/common/minigames/sv_minigames.qc index 46f989592..cb2beaa48 100644 --- a/qcsrc/common/minigames/sv_minigames.qc +++ b/qcsrc/common/minigames/sv_minigames.qc @@ -268,7 +268,7 @@ string invite_minigame(entity inviter, entity player) return "Invalid player"; if ( inviter == player ) return "You can't invite yourself"; - if (PlayerInList(player, autocvar_g_playban_list) && autocvar_g_playban_minigames) // playban + if (autocvar_g_playban_minigames && PlayerInList(player, autocvar_g_playban_list)) // playban return "You can't invite a banned player"; if ( CS(player).active_minigame == CS(inviter).active_minigame ) return strcat(player.netname," is already playing"); @@ -314,7 +314,7 @@ void ClientCommand_minigame(entity caller, int request, int argc, string command return; } - if (PlayerInList(caller, autocvar_g_playban_list) && autocvar_g_playban_minigames) // playban + if (autocvar_g_playban_minigames && PlayerInList(caller, autocvar_g_playban_list)) // playban { Send_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CENTER_JOIN_PLAYBAN); sprint(caller, "You aren't allowed to play minigames because you are banned from them in this server.\n"); diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index aa6b4eb56..dc118fac6 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -712,8 +712,9 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_CENTER_NOTIF(ITEM_WEAPON_UNAVAILABLE, N_ENABLE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^F1%s^BG is ^F4not available^BG on this map"), "") MSG_CENTER_NOTIF(JOIN_NOSPAWNS, N_ENABLE, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1No spawnpoints available!\nHope your team can fix it..."), "") - MSG_CENTER_NOTIF(JOIN_PREVENT, N_ENABLE, 0, 1, "f1", CPID_PREVENT_JOIN, "0 0", _("^K1You may not join the game at this time.\nThis match is limited to ^F2%s^BG players."), "") MSG_CENTER_NOTIF(JOIN_PLAYBAN, N_ENABLE, 0, 0, "", CPID_PREVENT_JOIN, "0 0", BOLD(_("^K1You aren't allowed to play because you are banned in this server")), "") + MSG_CENTER_NOTIF(JOIN_PREVENT, N_ENABLE, 0, 1, "f1", CPID_PREVENT_JOIN, "0 0", _("^K1You may not join the game at this time.\nThis match is limited to ^F2%s^BG players."), "") + MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME, N_ENABLE, 0, 0, "", CPID_Null, "0 0", _("^K1Cannot join given minigame session!"), "" ) MSG_CENTER_NOTIF(KEEPAWAY_DROPPED, N_ENABLE, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has dropped the ball!"), "") MSG_CENTER_NOTIF(KEEPAWAY_PICKUP, N_ENABLE, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has picked up the ball!"), "") @@ -798,8 +799,6 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_CENTER_NOTIF(TIMEOUT_BEGINNING, N_ENABLE, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "") MSG_CENTER_NOTIF(TIMEOUT_ENDING, N_ENABLE, 0, 1, "", CPID_TIMEIN, "1 f1", _("^F4Timeout ends in ^COUNT"), "") - MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME, N_ENABLE, 0, 0, "", CPID_Null, "0 0", _("^K1Cannot join given minigame session!"), "" ) - MSG_CENTER_NOTIF(VEHICLE_ENTER, N_ENABLE, 0, 0, "pass_key", CPID_VEHICLES, "0 0", _("^BGPress ^F2%s^BG to enter/exit the vehicle"), "") MSG_CENTER_NOTIF(VEHICLE_ENTER_GUNNER, N_ENABLE, 0, 0, "pass_key", CPID_VEHICLES, "0 0", _("^BGPress ^F2%s^BG to enter the vehicle gunner"), "") MSG_CENTER_NOTIF(VEHICLE_ENTER_STEAL, N_ENABLE, 0, 0, "pass_key", CPID_VEHICLES, "0 0", _("^BGPress ^F2%s^BG to steal this vehicle"), "") -- 2.39.2