Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: possible nil players in game events (again)
Browse files Browse the repository at this point in the history
akiver committed Jun 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2b3dd44 commit 0f16e51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/demoinfocs/game_events.go
Original file line number Diff line number Diff line change
@@ -154,6 +154,10 @@ func (geh gameEventHandler) playerByUserID(userID int) *common.Player {
}

func (geh gameEventHandler) playerByUserID32(userID int32) *common.Player {
if geh.parser.isSource2() && userID <= math.MaxUint16 {
userID &= 0xff
}

return geh.playerByUserID(int(userID))
}

0 comments on commit 0f16e51

Please sign in to comment.