File tree 1 file changed +12
-5
lines changed 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package demoinfocs
2
2
3
3
import (
4
4
"fmt"
5
+ "math"
5
6
6
7
"github.com/golang/geo/r3"
7
8
"github.com/markus-wa/go-unassert"
@@ -641,10 +642,6 @@ func (geh gameEventHandler) HostageRescuedAll(map[string]*msg.CSVCMsg_GameEventK
641
642
}
642
643
643
644
func (geh gameEventHandler ) playerConnect (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
644
- if geh .parser .isSource2 () {
645
- return
646
- }
647
-
648
645
pl := common.PlayerInfo {
649
646
UserID : int (data ["userid" ].GetValShort ()),
650
647
Name : data ["name" ].GetValString (),
@@ -662,7 +659,17 @@ func (geh gameEventHandler) playerConnect(data map[string]*msg.CSVCMsg_GameEvent
662
659
}
663
660
}
664
661
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 )
666
673
}
667
674
668
675
func (geh gameEventHandler ) playerDisconnect (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
You can’t perform that action at this time.
0 commit comments