Skip to content

Commit 919a289

Browse files
BestAwperEverakiver
authored andcommitted
workaround for legacy userid
1 parent 20d12ff commit 919a289

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/demoinfocs/game_events.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package demoinfocs
22

33
import (
44
"fmt"
5+
"math"
56

67
"github.com/golang/geo/r3"
78
"github.com/markus-wa/go-unassert"
@@ -661,6 +662,9 @@ func (geh gameEventHandler) playerConnect(data map[string]*msg.CSVCMsg_GameEvent
661662
var playerIndex int
662663
if geh.parser.isSource2() {
663664
playerIndex = pl.UserID
665+
if !pl.IsFakePlayer && !pl.IsHltv && pl.XUID > 0 && pl.UserID <= math.MaxUint8 {
666+
pl.UserID |= math.MaxUint8 << 8
667+
}
664668
} else {
665669
playerIndex = int(data["index"].GetValByte())
666670
}

0 commit comments

Comments
 (0)