From c301bdcee62ffb7db485676e76f711b1fe82d1d6 Mon Sep 17 00:00:00 2001 From: drjaska Date: Wed, 12 May 2021 22:30:04 +0300 Subject: [PATCH] fixed whitelisting and gave some score cvars better names --- gamemodes-server.cfg | 6 +++--- .../common/gamemodes/gamemode/mayhem/sv_mayhem.qc | 6 +++--- .../common/gamemodes/gamemode/mayhem/sv_mayhem.qh | 2 +- .../gamemodes/gamemode/tmayhem/sv_tmayhem.qc | 8 ++++---- .../gamemodes/gamemode/tmayhem/sv_tmayhem.qh | 4 ++-- qcsrc/server/world.qc | 15 +++++++-------- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 4d3821d17..c5979dde6 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -587,10 +587,10 @@ set g_tmayhem_scoringmethod 1 "1: 25% of the score is based on kills and 75% of set g_mayhem_fraglimit 30 "Team Mayhem basis for how many frags until the match ends, edit this over point_limit preferably" set g_tmayhem_fraglimit 50 "Team Mayhem basis for how many frags until the match ends, edit this over point_limit preferably" -set g_mayhem_point_limit 1000 "Mayhem visual score limit overriding the mapinfo specified one" -set g_tmayhem_point_limit 1000 "Team Mayhem visual score limit overriding the mapinfo specified one" +set g_mayhem_visual_score_limit 1000 "Mayhem visual score limit overriding the mapinfo specified one" +set g_tmayhem_visual_score_limit 1000 "Team Mayhem visual score limit overriding the mapinfo specified one" -set g_tmayhem_point_leadlimit -1 "Team Mayhem point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" +set g_tmayhem_score_leadlimit -1 "Team Mayhem score lead limit(based on tmayhem_visual_score_limit, not tmayhem_fraglimit) overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" set g_mayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" set g_tmayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc index ded24baaa..70bd1dcf8 100644 --- a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc +++ b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc @@ -13,10 +13,10 @@ void mayhem_DelayedInit(entity this) void mayhem_Initialize() { - if(autocvar_g_mayhem_point_limit > 0 && autocvar_g_mayhem_fraglimit > 0) - mayhempointmultiplier = autocvar_g_mayhem_point_limit / autocvar_g_mayhem_fraglimit; + if(autocvar_g_mayhem_visual_score_limit > 0 && autocvar_g_mayhem_fraglimit > 0) + mayhempointmultiplier = autocvar_g_mayhem_visual_score_limit / autocvar_g_mayhem_fraglimit; - GameRules_limit_score(autocvar_g_mayhem_point_limit); + GameRules_limit_score(autocvar_g_mayhem_visual_score_limit); InitializeEntity(NULL, mayhem_DelayedInit, INITPRIO_GAMETYPE); } diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh index 328dedc60..9393b311f 100644 --- a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh +++ b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh @@ -3,7 +3,7 @@ #include //someone who understands numbers better check if 2 following floats can be ints without imprecision, I'm scared of spaghettimonsters float autocvar_g_mayhem_fraglimit; -float autocvar_g_mayhem_point_limit; +float autocvar_g_mayhem_visual_score_limit; float mayhempointmultiplier = 1000/30; void mayhem_Initialize(); diff --git a/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc b/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc index 51c68c200..acb10404e 100644 --- a/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc +++ b/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc @@ -47,13 +47,13 @@ void tmayhem_DelayedInit(entity this) void tmayhem_Initialize() { - if(autocvar_g_tmayhem_point_limit != 0 && autocvar_g_tmayhem_fraglimit != 0) - tmayhempointmultiplier = autocvar_g_tmayhem_point_limit / autocvar_g_tmayhem_fraglimit; + if(autocvar_g_tmayhem_visual_score_limit != 0 && autocvar_g_tmayhem_fraglimit != 0) + tmayhempointmultiplier = autocvar_g_tmayhem_visual_score_limit / autocvar_g_tmayhem_fraglimit; GameRules_teams(true); GameRules_spawning_teams(autocvar_g_tmayhem_team_spawns); - GameRules_limit_score(autocvar_g_tmayhem_point_limit); - GameRules_limit_lead(autocvar_g_tmayhem_point_leadlimit); + GameRules_limit_score(autocvar_g_tmayhem_visual_score_limit); + GameRules_limit_lead(autocvar_g_tmayhem_score_leadlimit); InitializeEntity(NULL, tmayhem_DelayedInit, INITPRIO_GAMETYPE); } diff --git a/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qh b/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qh index 920f314f4..d8dbcdf76 100644 --- a/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qh +++ b/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qh @@ -3,8 +3,8 @@ #include //someone who understands numbers better check if 2 following floats can be ints without imprecision, I'm scared of spaghettimonsters float autocvar_g_tmayhem_fraglimit; -float autocvar_g_tmayhem_point_limit; -float autocvar_g_tmayhem_point_leadlimit; +float autocvar_g_tmayhem_visual_score_limit; +float autocvar_g_tmayhem_score_leadlimit; bool autocvar_g_tmayhem_team_spawns; float tmayhempointmultiplier = 1000/50; void tmayhem_Initialize(); diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 3f4445d08..ec031b34d 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -378,16 +378,15 @@ void cvar_changes_init() BADCVAR("g_spawn_alloweffects"); BADCVAR("g_tdm_point_leadlimit"); BADCVAR("g_tdm_point_limit"); - BADCVAR("g_tmayhem_point_leadlimit"); - BADCVAR("g_tmayhem_point_limit"); + BADCVAR("g_mayhem_fraglimit"); + BADCVAR("g_tmayhem_fraglimit"); + BADCVAR("g_mayhem_visual_score_limit"); + BADCVAR("g_tmayhem_visual_score_limit"); + BADCVAR("g_tmayhem_score_leadlimit"); BADCVAR("leadlimit_and_fraglimit"); BADCVAR("leadlimit_override"); - BADCVAR("g_mayhem_frags2score"); - BADCVAR("g_mayhem_damage2score"); - BADCVAR("g_mayhem_damage2score_multiplier"); - BADCVAR("g_tmayhem_frags2score"); - BADCVAR("g_tmayhem_damage2score"); - BADCVAR("g_tmayhem_damage2score_multiplier"); + BADCVAR("g_mayhem_scoringmethod"); + BADCVAR("g_tmayhem_scoringmethod"); BADCVAR("pausable"); BADCVAR("sv_announcer"); BADCVAR("sv_checkforpacketsduringsleep"); -- 2.39.2