File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ func (geh gameEventHandler) playerByUserID(userID int) *common.Player {
154154}
155155
156156func (geh gameEventHandler ) playerByUserID32 (userID int32 ) * common.Player {
157+ if geh .parser .isSource2 () && userID <= math .MaxUint16 {
158+ userID &= 0xff
159+ }
160+
157161 return geh .playerByUserID (int (userID ))
158162}
159163
@@ -682,6 +686,10 @@ func (geh gameEventHandler) playerConnect(data map[string]*msg.CSVCMsg_GameEvent
682686
683687func (geh gameEventHandler ) playerDisconnect (data map [string ]* msg.CSVCMsg_GameEventKeyT ) {
684688 uid := int (data ["userid" ].GetValShort ())
689+ if geh .parser .isSource2 () && uid <= math .MaxUint16 {
690+ uid &= 0xff
691+ }
692+
685693 pl := geh .playerByUserID (uid )
686694
687695 if geh .parser .isSource2 () {
You can’t perform that action at this time.
0 commit comments