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

Fix a crash issue #152

Merged
merged 1 commit into from
Jun 17, 2019
Merged
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
Fix a crash issue
  • Loading branch information
TomyLobo committed Jun 17, 2019
commit 4ba314ba3a0fe10d25eb1646a36c30f49c62f234
15 changes: 15 additions & 0 deletions mp/src/game/shared/sdk/sdk_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3201,12 +3201,27 @@ class CKickPlayerVoteIssue : public CDAIssue
ClientPrint( pForWhom, HUD_PRINTCONSOLE, "Nothing here.\n" );
}

virtual bool CanCallVote(int nEntIndex, const char *pszDetails, vote_create_failed_t &nFailCode, int &nTime)
{
int iUserID = atoi(pszDetails);
CBasePlayer* pPlayer = UTIL_PlayerByUserId(iUserID);
if (!pPlayer)
return false;

return CDAIssue::CanCallVote(nEntIndex, pszDetails, nFailCode, nTime);
}

virtual void SetIssueDetails(const char *pszDetails)
{
CDAIssue::SetIssueDetails(pszDetails);

int iUserID = atoi(pszDetails);
CBasePlayer* pPlayer = UTIL_PlayerByUserId(iUserID);

// We already check this in CanCallVote, but let's check it again, just to be safe...
if (!pPlayer)
return;

networkIDString = pPlayer->GetNetworkIDString();
}
};
Expand Down