Skip to content

Commit

Permalink
Fix (daemon): Fix daemon crashing for CS2 when first player connects
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Feb 2, 2024
1 parent 4c22b2e commit df087d0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scripts/hlstats.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,15 @@ sub getPlayerInfo
$userid = -3;
}
}
}
} else {
if ($g_servers{$s_addr}->{play_game} == CS2()) {
# leo - Workaround for bad logging from CS2 where first non-bot player may be assigned userid of `0`. By setting userid > 0, the player object will be created at the end of the function
# E.g. L 02/01/2024 - 21:02:01.253 - "X<0><[U:Y]><>" entered the game
if ($userid == 0) {
$userid = 0.1;
}
}
}

if ($g_mode eq "NameTrack") {
$uniqueid = $name;
Expand Down

0 comments on commit df087d0

Please sign in to comment.