Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cs2fixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,13 @@ void CS2Fixes::Hook_ClientCommand(CPlayerSlot slot, const CCommand& args)

if (g_cvarEnableZR.Get() && slot != -1 && !V_strncmp(args.Arg(0), "jointeam", 8))
{
// Bots use jointeam to finish connecting. SUPERCEDE is evaluated here,
// so an early return in ZR_Hook_ClientCommand_JoinTeam still blocks it
// and leaves fill's new bots stuck in challenging (status id 65535).
CCSPlayerController* pController = CCSPlayerController::FromSlot(slot);
if (pController && pController->IsBot())
RETURN_META(MRES_IGNORED);

ZR_Hook_ClientCommand_JoinTeam(slot, args);
RETURN_META(MRES_SUPERCEDE);
}
Expand Down
4 changes: 4 additions & 0 deletions src/zombiereborn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,10 @@ void ZR_Hook_ClientCommand_JoinTeam(CPlayerSlot slot, const CCommand& args)
if (!pController)
return;

// Engine jointeam is how bots finish connecting after bot_kick / quota refill.
if (pController->IsBot())
return;
Comment on lines +1590 to +1592

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant, because you're already checking IsBot in the only place this function is called.


CCSPlayerPawn* pPawn = (CCSPlayerPawn*)pController->GetPawn();
if (pPawn && pPawn->IsAlive())
pPawn->CommitSuicide(false, true);
Expand Down
Loading