fix: keep blocking respawns through the whole warmup teardown - #38
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral change matches the stated intent and the remaining feedback is limited to keeping newly added comments accurate to the actual reset points.
Pull request overview
Fixes a warmup teardown timing issue where g_bBlockRespawn was being cleared too quickly to reliably suppress ZombieReloaded delayed respawns during the end-of-warmup slay/restart sequence.
Changes:
- Keeps
g_bBlockRespawnset across the warmup teardown window (set inEndWarmUp(), no longer cleared immediately inTimer_ForceSuicide(), cleared later). - Hardens the
iCleanMode == 2entity cleanup loop (skip client indices, avoid stale classname buffer usage, and avoid redundant null checks).
File summaries
| File | Description |
|---|---|
| addons/sourcemod/scripting/TeamManager.sp | Extends the respawn-block window through warmup teardown and improves safety/efficiency of entity cleanup during warmup end. |
Review details
Suppressed comments (1)
addons/sourcemod/scripting/TeamManager.sp:254
- This comment says g_bBlockRespawn is reset in OnRoundEnd()/InitWarmup(), but the implementation also resets it in Timer_FireForward(). Align the comment with the actual reset points so the lifecycle of the flag is clear.
// g_bBlockRespawn stays set here: ZombieReloaded may respawn players on a
// delay after death, so clearing it right away would let them respawn
// during the warmup teardown. It is reset in OnRoundEnd()/InitWarmup().
g_bBlockRespawn = true;
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Timer_ForceSuicide() set g_bBlockRespawn to true and then cleared it in the same frame, right after the ForcePlayerSuicide() loop. ZombieReloaded respawns players on a delay after death, so by the time those respawns ran the flag was already false and ZR_OnClientRespawn() no longer blocked them. - Set g_bBlockRespawn when the suicide timer is scheduled and leave it set. It is cleared in OnRoundEnd(), Timer_FireForward() and InitWarmup(), all of which run once the round has actually restarted. - Harden the entity cleanup loop: hoist the null check out of the loop, start iteration past the client indices, and skip entities whose classname cannot be read. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rushaway
force-pushed
the
fix/warmup-end-respawn-block
branch
from
September 11, 2026 20:47
0083700 to
72b8307
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit finding —
g_bBlockRespawnwindow is effectively zeroTimer_ForceSuicide()did:g_bBlockRespawnis read byZR_OnClientRespawn()to suppressZombieReloaded respawns while warmup is ending. ZR respawns players on a
delay after death, so by the time those respawns fire the flag is
already back to
falseand players respawn in the middle of the warmupteardown / round restart — exactly what the flag is meant to prevent.
Changes
g_bBlockRespawnwhen the suicide timer is scheduled (inEndWarmUp()), and leave it set. It is cleared again inOnRoundEnd(),in
Timer_FireForward()(belt-and-suspenders, in caseround_endissuppressed) and in
InitWarmup()— all of which run once the round hasactually restarted.
iCleanMode == 2entity cleanup loop while here:g_hEntitiesListToKill != nullcheck out of the loop,MaxClients + 1(client indices can never be inthe kill list),
against a stale buffer.
🤖 Generated with Claude Code