Skip to content

Commit 120aa87

Browse files
authored
refactor(infect): simplify mother selection and RTD weights (#153)
- Removes weight logic from RTD system while keeping the core functionality. - Implements forced mother zombie selection and adjusts selection flow. - Fixes infection cycle to prevent external API calls from altering the process. - Cleans up deprecated weight-related CVars. - Update docs
1 parent a20ab3d commit 120aa87

4 files changed

Lines changed: 171 additions & 136 deletions

File tree

docs/index.html

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,42 +2912,6 @@ <h3><a id="3.10">3.10 Infection Module</a></h3>
29122912
</td>
29132913
</tr>
29142914

2915-
<tr>
2916-
<td class="commandheader">zr_infect_mzombie_weight_new</td>
2917-
<td class="commandheader">0.0</td>
2918-
</tr>
2919-
<tr>
2920-
<td class="indent" colspan="2">
2921-
<p>Weight for players who never were mother zombie (0.0-1.0) [Dependency: zr_infect_round_robin_rtd]</p>
2922-
<p>Options:<br />
2923-
0.0 - 1.0</p>
2924-
</td>
2925-
</tr>
2926-
2927-
<tr>
2928-
<td class="commandheader">zr_infect_mzombie_weight_rtd</td>
2929-
<td class="commandheader">0.25</td>
2930-
</tr>
2931-
<tr>
2932-
<td class="indent" colspan="2">
2933-
<p>Weight for players in RTD cycle only (0.0-1.0) [Dependency: zr_infect_round_robin_rtd]</p>
2934-
<p>Options:<br />
2935-
0.0 - 1.0</p>
2936-
</td>
2937-
</tr>
2938-
2939-
<tr>
2940-
<td class="commandheader">zr_infect_mzombie_weight_both</td>
2941-
<td class="commandheader">0.75</td>
2942-
</tr>
2943-
<tr>
2944-
<td class="indent" colspan="2">
2945-
<p>Weight for players in both cycles (0.0-1.0) [Dependency: zr_infect_round_robin_rtd]</p>
2946-
<p>Options:<br />
2947-
0.0 - 1.0</p>
2948-
</td>
2949-
</tr>
2950-
29512915
<tr>
29522916
<td class="commandheader">zr_infect_spawntime_min</td>
29532917
<td class="commandheader">30.0</td>
@@ -2999,18 +2963,11 @@ <h3><a id="3.10">3.10 Infection Module</a></h3>
29992963
<tr>
30002964
<td class="indent" colspan="2">
30012965
<p>Roll the dice for players new to the random round-robin SteamID cache to make it fair for late joiners.</p>
3002-
<p>Base chance is calculated from the ratio of players in the cycle to total players</p>
3003-
<p>Player weights are applied based on their history: (Higher weight means higher chance of being selected.)</p>
3004-
<ul>
3005-
<li>New players: Highest chance of selection [Dependency: zr_infect_mzombie_weight_new]</li>
3006-
<li>RTD cycle only: Medium chance of selection [Dependency: zr_infect_mzombie_weight_rtd]</li>
3007-
<li>Both cycles: Lowest chance of selection [Dependency: zr_infect_mzombie_weight_both]</li>
3008-
</ul>
30092966
<p>Options:<br />
30102967
0 or 1</p>
30112968
</td>
30122969
</tr>
3013-
2970+
30142971
<tr>
30152972
<td class="commandheader">zr_infect_weapons_drop</td>
30162973
<td class="commandheader">1</td>

src/addons/sourcemod/scripting/zr/cvars.inc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ enum struct CvarsList
120120
ConVar CVAR_INFECT_MZOMBIE_COUNTDOWN;
121121
ConVar CVAR_INFECT_MZOMBIE_RESPAWN;
122122
ConVar CVAR_INFECT_MZOMBIE_RESPAWN_WARNING;
123-
ConVar CVAR_INFECT_MZOMBIE_WEIGHT_NEW;
124-
ConVar CVAR_INFECT_MZOMBIE_WEIGHT_RTD;
125-
ConVar CVAR_INFECT_MZOMBIE_WEIGHT_BOTH;
126123
ConVar CVAR_INFECT_EXPLOSION;
127124
ConVar CVAR_INFECT_FIREBALL;
128125
ConVar CVAR_INFECT_SMOKE;
@@ -331,9 +328,6 @@ void CvarsCreate()
331328
g_hCvarsList.CVAR_INFECT_MZOMBIE_COUNTDOWN = CreateConVar("zr_infect_mzombie_countdown", "1", "Counts down to the first infection of the round. Countdown is printed in the middle of the client's screen.");
332329
g_hCvarsList.CVAR_INFECT_MZOMBIE_RESPAWN = CreateConVar("zr_infect_mzombie_respawn", "0", "Teleport mother zombies back to spawn on infect.");
333330
g_hCvarsList.CVAR_INFECT_MZOMBIE_RESPAWN_WARNING = CreateConVar("zr_infect_mzombie_respawn_warning", "1", "Whether to warn players of zombies spawning between humans.");
334-
g_hCvarsList.CVAR_INFECT_MZOMBIE_WEIGHT_NEW = CreateConVar("zr_infect_mzombie_weight_new", "0.0", "Weight for players who never were mother zombie (0.0-1.0)");
335-
g_hCvarsList.CVAR_INFECT_MZOMBIE_WEIGHT_RTD = CreateConVar("zr_infect_mzombie_weight_rtd", "0.25", "Weight for players in RTD cycle only (0.0-1.0)");
336-
g_hCvarsList.CVAR_INFECT_MZOMBIE_WEIGHT_BOTH = CreateConVar("zr_infect_mzombie_weight_both", "0.75", "Weight for players in both cycles (0.0-1.0)");
337331
g_hCvarsList.CVAR_INFECT_SPAWNTIME_MIN = CreateConVar("zr_infect_spawntime_min", "30.0", "Minimum time from the start of the round until picking the mother zombie(s).");
338332
g_hCvarsList.CVAR_INFECT_SPAWNTIME_MAX = CreateConVar("zr_infect_spawntime_max", "50.0", "Maximum time from the start of the round until picking the mother zombie(s).");
339333
g_hCvarsList.CVAR_INFECT_CONSECUTIVE_BLOCK = CreateConVar("zr_infect_consecutive_block", "1", "Prevent a player from being chosen as mother zombie two rounds in a row.");

src/addons/sourcemod/scripting/zr/hgversion.h.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define ZR_VER_BRANCH "master"
55
#define ZR_VER_MAJOR "3"
66
#define ZR_VER_MINOR "12"
7-
#define ZR_VER_PATCH "29"
7+
#define ZR_VER_PATCH "30"
88
#define ZR_VERSION ZR_VER_MAJOR..."."...ZR_VER_MINOR..."."...ZR_VER_PATCH
99
#define ZR_VER_LICENSE "GNU GPL, Version 3"
10-
#define ZR_VER_DATE "Mon Mar 09 11:00:00 CET 2026"
10+
#define ZR_VER_DATE "Thu May 21 CEST 2026"

0 commit comments

Comments
 (0)