Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kicking last zombie prevents round from ending #271

Open
Frozen-H2O opened this issue Aug 1, 2024 · 1 comment
Open

Kicking last zombie prevents round from ending #271

Frozen-H2O opened this issue Aug 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Frozen-H2O
Copy link
Collaborator

Frozen-H2O commented Aug 1, 2024

If the last living zombie is kicked from the server after zombie respawning is disabled, the round will not end.
Presumably the same thing will happen when the last zombie simply disconnects without a kick, but I did not test if that happened.

@Vauff Vauff added the bug Something isn't working label Aug 11, 2024
@Vauff
Copy link
Contributor

Vauff commented Aug 11, 2024

CS2Fixes/src/zombiereborn.cpp

Lines 1595 to 1602 in ba6f83d

CCSPlayerController *pVictimController = (CCSPlayerController*)pEvent->GetPlayerController("userid");
if (!pVictimController)
return;
CCSPlayerPawn *pVictimPawn = (CCSPlayerPawn*)pVictimController->GetPawn();
if (!pVictimPawn)
return;
ZR_CheckTeamWinConditions(pVictimPawn->m_iTeamNum() == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T);

They fail the null checks, but we also need pawn to get the team.

Ice:
"If disconnects dont give team info, why not just check both teams' win conditions when there is no controller/pawn? and if first win check for ZMs returns true, just skip the CTs' win check (in case everyone is dead)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants