File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package demoinfocs
22
33import (
44 "fmt"
5+ "math"
56
67 "github.com/golang/geo/r3"
78 "github.com/markus-wa/go-unassert"
@@ -641,10 +642,6 @@ func (geh gameEventHandler) HostageRescuedAll(map[string]*msg.CSVCMsg_GameEventK
641642}
642643
643644func (geh gameEventHandler ) playerConnect (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
644- if geh .parser .isSource2 () {
645- return
646- }
647-
648645 pl := common.PlayerInfo {
649646 UserID : int (data ["userid" ].GetValShort ()),
650647 Name : data ["name" ].GetValString (),
@@ -662,7 +659,17 @@ func (geh gameEventHandler) playerConnect(data map[string]*msg.CSVCMsg_GameEvent
662659 }
663660 }
664661
665- geh .parser .setRawPlayer (int (data ["index" ].GetValByte ()), pl )
662+ var playerIndex int
663+ if geh .parser .isSource2 () {
664+ playerIndex = pl .UserID
665+ if ! pl .IsFakePlayer && ! pl .IsHltv && pl .XUID > 0 && pl .UserID <= math .MaxUint8 {
666+ pl .UserID |= math .MaxUint8 << 8
667+ }
668+ } else {
669+ playerIndex = int (data ["index" ].GetValByte ())
670+ }
671+
672+ geh .parser .setRawPlayer (playerIndex , pl )
666673}
667674
668675func (geh gameEventHandler ) playerDisconnect (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
You can’t perform that action at this time.
0 commit comments