Skip to content

Commit

Permalink
Fix a crash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyLobo committed Jun 17, 2019
1 parent 33e09ee commit 4ba314b
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 4ba314b

Please sign in to comment.