Skip to content

Commit

Permalink
workaround for legacy userid
Browse files Browse the repository at this point in the history
  • Loading branch information
BestAwperEver authored and akiver committed May 16, 2024
1 parent 20d12ff commit 919a289
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
Expand Up @@ -2,6 +2,7 @@ package demoinfocs

import (
"fmt"
"math"

"github.com/golang/geo/r3"
"github.com/markus-wa/go-unassert"
Expand Down Expand Up @@ -661,6 +662,9 @@ func (geh gameEventHandler) playerConnect(data map[string]*msg.CSVCMsg_GameEvent
var playerIndex int
if geh.parser.isSource2() {
playerIndex = pl.UserID
if !pl.IsFakePlayer && !pl.IsHltv && pl.XUID > 0 && pl.UserID <= math.MaxUint8 {

Check failure on line 665 in pkg/demoinfocs/game_events.go

View workflow job for this annotation

GitHub Actions / ci

[golangci-lint] reported by reviewdog 🐶 if statements should only be cuddled with assignments used in the if statement itself (wsl) Raw Output: pkg/demoinfocs/game_events.go:665:3: if statements should only be cuddled with assignments used in the if statement itself (wsl) if !pl.IsFakePlayer && !pl.IsHltv && pl.XUID > 0 && pl.UserID <= math.MaxUint8 { ^
pl.UserID |= math.MaxUint8 << 8
}
} else {
playerIndex = int(data["index"].GetValByte())
}
Expand Down

0 comments on commit 919a289

Please sign in to comment.