-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: users not found in game events with new demos #475
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #475 +/- ##
==========================================
+ Coverage 80.51% 80.53% +0.01%
==========================================
Files 47 47
Lines 6292 6298 +6
==========================================
+ Hits 5066 5072 +6
Misses 1017 1017
Partials 209 209 ☔ View full report in Codecov by Sentry. |
Otherwise the player may be the GOTV entity in case of damages/kill by the "world".
@@ -119,7 +119,17 @@ func (geh gameEventHandler) gameState() *gameState { | |||
} | |||
|
|||
func (geh gameEventHandler) playerByUserID(userID int) *common.Player { | |||
return geh.gameState().playersByUserID[userID] | |||
player := geh.gameState().playersByUserID[userID] | |||
if player != nil || !geh.parser.isSource2() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't change it for Source 1 demos because in case of damages/kills done by the "world" it would return the GOTV entity (id 0
) instead of nil.
In Source 2 the CSTV entity ID is not always 0 and may have SourceTV
or DemoAutoRecorder
as a name.
Since the last update, game events contain "user slot" rather than "user id" that come from the userinfo table.
Tested on a bunch of valve and faceit demos.
fix #476