From 97e90f5489fe1e557cb9f3e319fe69e99fa6ccaa Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Mon, 10 Apr 2023 23:22:42 +0200 Subject: [PATCH] Replace 'sv' into 'surv' to avoid possible future confusions --- gamemodes-client.cfg | 2 +- gamemodes-server.cfg | 18 ++--- .../gamemode/survival/cl_survival.qc | 16 ++--- .../gamemodes/gamemode/survival/survival.qh | 10 +-- .../gamemode/survival/sv_survival.qc | 68 +++++++++---------- .../gamemode/survival/sv_survival.qh | 2 +- qcsrc/common/scores.qh | 4 +- 7 files changed, 60 insertions(+), 60 deletions(-) diff --git a/gamemodes-client.cfg b/gamemodes-client.cfg index 6960fe2dc..c0562cfb8 100644 --- a/gamemodes-client.cfg +++ b/gamemodes-client.cfg @@ -34,7 +34,7 @@ alias cl_hook_gamestart_inv alias cl_hook_gamestart_duel alias cl_hook_gamestart_mayhem alias cl_hook_gamestart_tmayhem -alias cl_hook_gamestart_sv +alias cl_hook_gamestart_surv alias cl_hook_gameend alias cl_hook_shutdown alias cl_hook_activeweapon diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 2d4d8a396..23c97924e 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -31,7 +31,7 @@ alias sv_hook_gamestart_inv alias sv_hook_gamestart_duel alias sv_hook_gamestart_mayhem alias sv_hook_gamestart_tmayhem -alias sv_hook_gamestart_sv +alias sv_hook_gamestart_surv // there is currently no hook for when the match is restarted // see sv_hook_readyrestart for previous uses of this hook //alias sv_hook_gamerestart @@ -63,7 +63,7 @@ alias sv_vote_gametype_hook_tdm alias sv_vote_gametype_hook_duel alias sv_vote_gametype_hook_mayhem alias sv_vote_gametype_hook_tmayhem -alias sv_vote_gametype_hook_sv +alias sv_vote_gametype_hook_surv // Example preset to allow 1v1ctf to be used for the gametype voting screen. // Aliases can have max 31 chars so the gametype can have max 9 chars. @@ -228,13 +228,13 @@ set g_tmayhem_respawn_delay_large_count 0 set g_tmayhem_respawn_delay_max 0 set g_tmayhem_respawn_waves 0 set g_tmayhem_weapon_stay 0 -set g_sv_respawn_delay_small 0 -set g_sv_respawn_delay_small_count 0 -set g_sv_respawn_delay_large 0 -set g_sv_respawn_delay_large_count 0 -set g_sv_respawn_delay_max 0 -set g_sv_respawn_waves 0 -set g_sv_weapon_stay 0 +set g_surv_respawn_delay_small 0 +set g_surv_respawn_delay_small_count 0 +set g_surv_respawn_delay_large 0 +set g_surv_respawn_delay_large_count 0 +set g_surv_respawn_delay_max 0 +set g_surv_respawn_waves 0 +set g_surv_weapon_stay 0 // ========= diff --git a/qcsrc/common/gamemodes/gamemode/survival/cl_survival.qc b/qcsrc/common/gamemodes/gamemode/survival/cl_survival.qc index 285d48ea2..02d0907ab 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/cl_survival.qc +++ b/qcsrc/common/gamemodes/gamemode/survival/cl_survival.qc @@ -11,13 +11,13 @@ void HUD_Mod_Survival(vector pos, vector mySize) string player_text = ""; vector player_color = '1 1 1'; //string player_icon = ""; - if(mystatus == SV_STATUS_HUNTER) + if(mystatus == SURV_STATUS_HUNTER) { player_text = _("Hunter"); player_color = '1 0 0'; //player_icon = "player_red"; } - else if(mystatus == SV_STATUS_PREY) + else if(mystatus == SURV_STATUS_PREY) { player_text = _("Survivor"); player_color = '0 1 0'; @@ -32,9 +32,9 @@ void HUD_Mod_Survival(vector pos, vector mySize) drawstring_aspect(pos, player_text, vec2(mySize.x, mySize.y), player_color, panel_fg_alpha, DRAWFLAG_NORMAL); } -REGISTER_MUTATOR(cl_sv, true); +REGISTER_MUTATOR(cl_surv, true); -MUTATOR_HOOKFUNCTION(cl_sv, ForcePlayercolors_Skip, CBC_ORDER_LAST) +MUTATOR_HOOKFUNCTION(cl_surv, ForcePlayercolors_Skip, CBC_ORDER_LAST) { if(!ISGAMETYPE(SURVIVAL)) return false; @@ -44,15 +44,15 @@ MUTATOR_HOOKFUNCTION(cl_sv, ForcePlayercolors_Skip, CBC_ORDER_LAST) int surv_status = ((e) ? e.survival_status : 0); int mystatus = entcs_receiver(player_localnum).survival_status; - int plcolor = SV_COLOR_PREY; // default to survivor - if((mystatus == SV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SV_STATUS_HUNTER) - plcolor = SV_COLOR_HUNTER; + int plcolor = SURV_COLOR_PREY; // default to survivor + if((mystatus == SURV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SURV_STATUS_HUNTER) + plcolor = SURV_COLOR_HUNTER; player.colormap = 1024 + plcolor; return true; } -MUTATOR_HOOKFUNCTION(cl_sv, DrawScoreboard_Force) +MUTATOR_HOOKFUNCTION(cl_surv, DrawScoreboard_Force) { // show the scoreboard when the round ends, so players can see who the hunter was return STAT(GAME_STOPPED); diff --git a/qcsrc/common/gamemodes/gamemode/survival/survival.qh b/qcsrc/common/gamemodes/gamemode/survival/survival.qh index 4b52ed200..baddfb5c2 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/survival.qh +++ b/qcsrc/common/gamemodes/gamemode/survival/survival.qh @@ -9,7 +9,7 @@ void HUD_Mod_Survival(vector pos, vector mySize); CLASS(Survival, Gametype) INIT(Survival) { - this.gametype_init(this, _("Survival"),"sv","g_survival",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=12",_("Identify and eliminate all the hunters before all your allies are gone")); + this.gametype_init(this, _("Survival"), "surv", "g_survival", GAMETYPE_FLAG_USEPOINTS, "", "timelimit=20 pointlimit=12", _("Identify and eliminate all the hunters before all your allies are gone")); } METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) { @@ -34,10 +34,10 @@ REGISTER_GAMETYPE(SURVIVAL, NEW(Survival)); #ifdef GAMEQC // shared state signalling the player's survival status .int survival_status; -const int SV_STATUS_PREY = 1; -const int SV_STATUS_HUNTER = 2; +const int SURV_STATUS_PREY = 1; +const int SURV_STATUS_HUNTER = 2; // hardcoded player colors for survival -const int SV_COLOR_PREY = 51; // green -const int SV_COLOR_HUNTER = 68; // red +const int SURV_COLOR_PREY = 51; // green +const int SURV_COLOR_HUNTER = 68; // red #endif diff --git a/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc b/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc index 85e40e817..6414686e0 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc +++ b/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc @@ -20,12 +20,12 @@ void Surv_UpdateScores(bool timed_out) // player survived the round if(IS_PLAYER(it) && !IS_DEAD(it)) { - if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SV_STATUS_PREY) + if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SURV_STATUS_PREY) GameRules_scoring_add(it, SCORE, 1); // reward survivors who make it to the end of the round time limit - if(it.survival_status == SV_STATUS_PREY) - GameRules_scoring_add(it, SV_SURVIVALS, 1); - else if(it.survival_status == SV_STATUS_HUNTER) - GameRules_scoring_add(it, SV_HUNTS, 1); + if(it.survival_status == SURV_STATUS_PREY) + GameRules_scoring_add(it, SURV_SURVIVALS, 1); + else if(it.survival_status == SURV_STATUS_HUNTER) + GameRules_scoring_add(it, SURV_HUNTS, 1); } }); } @@ -54,9 +54,9 @@ float Surv_CheckWinner() int survivor_count = 0, hunter_count = 0; FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), { - if(it.survival_status == SV_STATUS_PREY) + if(it.survival_status == SURV_STATUS_PREY) survivor_count++; - else if(it.survival_status == SV_STATUS_HUNTER) + else if(it.survival_status == SURV_STATUS_HUNTER) hunter_count++; }); if(survivor_count > 0 && hunter_count > 0) @@ -104,7 +104,7 @@ void Surv_RoundStart() if(IS_PLAYER(it) && !IS_DEAD(it)) { ++playercount; - it.survival_status = SV_STATUS_PREY; + it.survival_status = SURV_STATUS_PREY; } else it.survival_status = 0; // this is mostly a safety check; if a client manages to somehow maintain a survival status, clear it before the round starts! @@ -117,14 +117,14 @@ void Surv_RoundStart() if(total_hunters >= hunter_count) break; total_hunters++; - it.survival_status = SV_STATUS_HUNTER; + it.survival_status = SURV_STATUS_HUNTER; }); FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), { - if(it.survival_status == SV_STATUS_PREY) + if(it.survival_status == SURV_STATUS_PREY) Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_SURVIVOR); - else if(it.survival_status == SV_STATUS_HUNTER) + else if(it.survival_status == SURV_STATUS_HUNTER) Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_HUNTER); }); } @@ -173,8 +173,8 @@ bool surv_isEliminated(entity e) void surv_Initialize() // run at the start of a match, initiates game mode { GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, { - field(SP_SV_SURVIVALS, "survivals", 0); - field(SP_SV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY); + field(SP_SURV_SURVIVALS, "survivals", 0); + field(SP_SURV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY); }); allowed_to_spawn = true; @@ -188,7 +188,7 @@ void surv_Initialize() // run at the start of a match, initiates game mode // Hook Functions // ============== -MUTATOR_HOOKFUNCTION(sv, ClientObituary) +MUTATOR_HOOKFUNCTION(surv, ClientObituary) { // in survival, announcing a frag would tell everyone who the hunter is entity frag_attacker = M_ARGV(1, entity); @@ -203,11 +203,11 @@ MUTATOR_HOOKFUNCTION(sv, ClientObituary) GiveFrags(frag_attacker, frag_target, ((autocvar_g_survival_punish_teamkill) ? -1 : -2), frag_deathtype, wep_ent.weaponentity_fld); } - if(frag_attacker.survival_status == SV_STATUS_HUNTER) + if(frag_attacker.survival_status == SURV_STATUS_HUNTER) M_ARGV(5, bool) = true; // anonymous attacker } -MUTATOR_HOOKFUNCTION(sv, PlayerPreThink) +MUTATOR_HOOKFUNCTION(surv, PlayerPreThink) { entity player = M_ARGV(0, entity); @@ -215,14 +215,14 @@ MUTATOR_HOOKFUNCTION(sv, PlayerPreThink) { // update the scoreboard colour display to out the real killer at the end of the round // running this every frame to avoid cheats - int plcolor = SV_COLOR_PREY; - if(player.survival_status == SV_STATUS_HUNTER && game_stopped) - plcolor = SV_COLOR_HUNTER; + int plcolor = SURV_COLOR_PREY; + if(player.survival_status == SURV_STATUS_HUNTER && game_stopped) + plcolor = SURV_COLOR_HUNTER; setcolor(player, plcolor); } } -MUTATOR_HOOKFUNCTION(sv, PlayerSpawn) +MUTATOR_HOOKFUNCTION(surv, PlayerSpawn) { entity player = M_ARGV(0, entity); @@ -233,7 +233,7 @@ MUTATOR_HOOKFUNCTION(sv, PlayerSpawn) eliminatedPlayers.SendFlags |= 1; } -MUTATOR_HOOKFUNCTION(sv, ForbidSpawn) +MUTATOR_HOOKFUNCTION(surv, ForbidSpawn) { entity player = M_ARGV(0, entity); @@ -245,7 +245,7 @@ MUTATOR_HOOKFUNCTION(sv, ForbidSpawn) return false; } -MUTATOR_HOOKFUNCTION(sv, PutClientInServer) +MUTATOR_HOOKFUNCTION(surv, PutClientInServer) { entity player = M_ARGV(0, entity); @@ -260,7 +260,7 @@ MUTATOR_HOOKFUNCTION(sv, PutClientInServer) } } -MUTATOR_HOOKFUNCTION(sv, reset_map_players) +MUTATOR_HOOKFUNCTION(surv, reset_map_players) { FOREACH_CLIENT(true, { CS(it).killcount = 0; @@ -276,7 +276,7 @@ MUTATOR_HOOKFUNCTION(sv, reset_map_players) return true; } -MUTATOR_HOOKFUNCTION(sv, reset_map_global) +MUTATOR_HOOKFUNCTION(surv, reset_map_global) { allowed_to_spawn = true; return true; @@ -307,7 +307,7 @@ void surv_LastPlayerForTeam_Notify(entity this) } } -MUTATOR_HOOKFUNCTION(sv, PlayerDies) +MUTATOR_HOOKFUNCTION(surv, PlayerDies) { entity frag_attacker = M_ARGV(1, entity); entity frag_target = M_ARGV(2, entity); @@ -335,7 +335,7 @@ MUTATOR_HOOKFUNCTION(sv, PlayerDies) return true; } -MUTATOR_HOOKFUNCTION(sv, ClientDisconnect) +MUTATOR_HOOKFUNCTION(surv, ClientDisconnect) { entity player = M_ARGV(0, entity); @@ -344,7 +344,7 @@ MUTATOR_HOOKFUNCTION(sv, ClientDisconnect) return true; } -MUTATOR_HOOKFUNCTION(sv, MakePlayerObserver) +MUTATOR_HOOKFUNCTION(surv, MakePlayerObserver) { entity player = M_ARGV(0, entity); bool is_forced = M_ARGV(1, bool); @@ -368,13 +368,13 @@ MUTATOR_HOOKFUNCTION(sv, MakePlayerObserver) return true; // prevent team reset } -MUTATOR_HOOKFUNCTION(sv, Scores_CountFragsRemaining) +MUTATOR_HOOKFUNCTION(surv, Scores_CountFragsRemaining) { // announce remaining frags? return true; } -MUTATOR_HOOKFUNCTION(sv, GiveFragsForKill, CBC_ORDER_FIRST) +MUTATOR_HOOKFUNCTION(surv, GiveFragsForKill, CBC_ORDER_FIRST) { entity frag_attacker = M_ARGV(0, entity); if(!warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted()) @@ -383,20 +383,20 @@ MUTATOR_HOOKFUNCTION(sv, GiveFragsForKill, CBC_ORDER_FIRST) return true; } -MUTATOR_HOOKFUNCTION(sv, AddPlayerScore) +MUTATOR_HOOKFUNCTION(surv, AddPlayerScore) { entity scorefield = M_ARGV(0, entity); if(scorefield == SP_KILLS || scorefield == SP_DEATHS || scorefield == SP_SUICIDES || scorefield == SP_DMG || scorefield == SP_DMGTAKEN) M_ARGV(1, float) = 0; // don't report that the player has killed or been killed, that would out them as a hunter! } -MUTATOR_HOOKFUNCTION(sv, CalculateRespawnTime) +MUTATOR_HOOKFUNCTION(surv, CalculateRespawnTime) { // no respawn calculations needed, player is forced to spectate anyway return true; } -MUTATOR_HOOKFUNCTION(sv, Bot_FixCount, CBC_ORDER_EXCLUSIVE) +MUTATOR_HOOKFUNCTION(surv, Bot_FixCount, CBC_ORDER_EXCLUSIVE) { FOREACH_CLIENT(IS_REAL_CLIENT(it), { if (IS_PLAYER(it) || INGAME_JOINED(it)) @@ -406,7 +406,7 @@ MUTATOR_HOOKFUNCTION(sv, Bot_FixCount, CBC_ORDER_EXCLUSIVE) return true; } -MUTATOR_HOOKFUNCTION(sv, ClientCommand_Spectate) +MUTATOR_HOOKFUNCTION(surv, ClientCommand_Spectate) { entity player = M_ARGV(0, entity); @@ -421,7 +421,7 @@ MUTATOR_HOOKFUNCTION(sv, ClientCommand_Spectate) return MUT_SPECCMD_CONTINUE; } -MUTATOR_HOOKFUNCTION(sv, BotShouldAttack) +MUTATOR_HOOKFUNCTION(surv, BotShouldAttack) { entity bot = M_ARGV(0, entity); entity targ = M_ARGV(1, entity); diff --git a/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qh b/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qh index 822cfd0eb..129410a5a 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qh +++ b/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qh @@ -4,7 +4,7 @@ #include void surv_Initialize(); -REGISTER_MUTATOR(sv, false) +REGISTER_MUTATOR(surv, false) { MUTATOR_STATIC(); MUTATOR_ONADD diff --git a/qcsrc/common/scores.qh b/qcsrc/common/scores.qh index 805a022a7..18a74c1bf 100644 --- a/qcsrc/common/scores.qh +++ b/qcsrc/common/scores.qh @@ -60,8 +60,8 @@ REGISTER_SP(NEXBALL_FAULTS); REGISTER_SP(ONS_CAPS); REGISTER_SP(ONS_TAKES); -REGISTER_SP(SV_SURVIVALS); -REGISTER_SP(SV_HUNTS); +REGISTER_SP(SURV_SURVIVALS); +REGISTER_SP(SURV_HUNTS); REGISTER_SP(SCORE); REGISTER_SP(KILLS); -- 2.39.2