From: bones_was_here Date: Sun, 9 Jun 2024 16:07:19 +0000 (+1000) Subject: Enable sv_teamnagger in CA, remove HideTeamNagger mutator hook X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=20d4f42a1cd3f892017f27ab67dd2b006c094afb;p=xonotic%2Fxonotic-data.pk3dir.git Enable sv_teamnagger in CA, remove HideTeamNagger mutator hook sv_teamnagger seems to work fine in CA and is already disabled in gametypes without teams. --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index dbb089ab0..5315d1e88 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -641,11 +641,6 @@ MUTATOR_HOOKFUNCTION(ca, ClientCommand_Spectate) return MUT_SPECCMD_CONTINUE; } -MUTATOR_HOOKFUNCTION(ca, HideTeamNagger) -{ - return true; // doesn't work well with the whole spectator as player thing -} - MUTATOR_HOOKFUNCTION(ca, SetWeaponArena) { if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "") diff --git a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc index fc13875b1..f90030895 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc @@ -347,11 +347,6 @@ MUTATOR_HOOKFUNCTION(cts, Race_FinalCheckpoint) ClientKill_Silent(player, autocvar_g_cts_finish_kill_delay); } -MUTATOR_HOOKFUNCTION(cts, HideTeamNagger) -{ - return true; // doesn't work so well (but isn't cts a teamless mode?) -} - MUTATOR_HOOKFUNCTION(cts, FixClientCvars) { entity player = M_ARGV(0, entity); diff --git a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc index f06df370d..042217928 100644 --- a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@ -357,11 +357,6 @@ MUTATOR_HOOKFUNCTION(rc, GetRecords) M_ARGV(1, string) = ret_string; } -MUTATOR_HOOKFUNCTION(rc, HideTeamNagger) -{ - return true; // doesn't work so well -} - MUTATOR_HOOKFUNCTION(rc, FixClientCvars) { entity player = M_ARGV(0, entity); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 0d804177b..e41cd9d4d 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -141,7 +141,6 @@ bool ClientData_Send(entity this, entity to, int sf) if (autocvar_sv_showspectators == 1 || (autocvar_sv_showspectators && IS_SPEC(to))) sf |= BIT(4); // show spectators if (autocvar_sv_teamnagger && teamplay && !(autocvar_bot_vs_human && AVAILABLE_TEAMS == 2)) - if (!MUTATOR_CALLHOOK(HideTeamNagger, this)) // enable teamnagger sf |= (autocvar_sv_teamnagger & 0x03) << 5; // BIT(5) | BIT(6) WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA); diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 57e1f8990..0d0598a41 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -552,7 +552,7 @@ void ReadyCount() // This allows warmup to end with zero players to prevent complaints // of server never changing map with legacy config (sv_autopause 0). bool badteams = (teamplay && total_players && autocvar_sv_teamnagger) - ? !MUTATOR_CALLHOOK(HideTeamNagger, NULL) && TeamBalance_SizeDifference(NULL) >= autocvar_sv_teamnagger + ? TeamBalance_SizeDifference(NULL) >= autocvar_sv_teamnagger : false; if (total_players < minplayers || badteams) diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 533484d0b..34155a4d3 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -1190,12 +1190,6 @@ enum { MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target) }; -/** return true to hide the 'teamnumbers are imbalanced' message */ -#define EV_HideTeamNagger(i, o) \ - /** player */ i(entity, MUTATOR_ARGV_0_entity) \ - /**/ -MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger); - /** return true to show a waypoint while the item is spawning */ #define EV_Item_ScheduleRespawn(i, o) \ /** item */ i(entity, MUTATOR_ARGV_0_entity) \