Skip to content

Commit 5543f4b

Browse files
committed
fix: preserve possible nil player with csgo demos
Otherwise the player may be the GOTV entity in case of damages/kill by the "world".
1 parent 7d37718 commit 5543f4b

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

pkg/demoinfocs/game_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (geh gameEventHandler) gameState() *gameState {
120120

121121
func (geh gameEventHandler) playerByUserID(userID int) *common.Player {
122122
player := geh.gameState().playersByUserID[userID]
123-
if player != nil {
123+
if player != nil || !geh.parser.isSource2() {
124124
return player
125125
}
126126

test/default.golden

1.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)