You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Hi, I've tried to parse a demo from match containing disconnected player. The code just gets the health of every player on every game tick. I've got panic error property 'm_iHealth' not found.
I provide my ideas at the end of issue.
Expected behavior
Clear parsing to end without errors printing 0 as last player health.
Library version
v4.2.3
My solution
Main problem is that user with steamId = 76561198886630731 is listed in participants. He is disconnected, but all methods are tried to be applied to him. But his "entity" doesn't contain needed properties.
This patch #489 does not solve the problem because this player has property p.Entity.PropertyValue("m_hPawn"). This checking does not find that he is disconnected.
For me helped adding this checking:
parser.RegisterEventHandler(func(any) {
gs := parser.GameState()
for _, player := range gs.Participants().Playing() {
if player == nil || player.PlayerPawnEntity() == nil ||
player.PlayerPawnEntity().ServerClass().Name() != "CCSPlayerPawn" {
continue
}
dummy = player.Health()
}
})
Maybe this checking should be made in all places mentioned in #489.
The text was updated successfully, but these errors were encountered:
Description
Hi, I've tried to parse a demo from match containing disconnected player. The code just gets the health of every player on every game tick. I've got panic error
property 'm_iHealth' not found
.I provide my ideas at the end of issue.
Stacktrace
To Reproduce
To Reproduce you may download demo: disconnected_de_anubis.dem and run the following code.
Code:
Expected behavior
Clear parsing to end without errors printing 0 as last player health.
Library version
v4.2.3
My solution
Main problem is that user with
steamId = 76561198886630731
is listed in participants. He is disconnected, but all methods are tried to be applied to him. But his "entity" doesn't contain needed properties.This patch #489 does not solve the problem because this player has property
p.Entity.PropertyValue("m_hPawn")
. This checking does not find that he is disconnected.For me helped adding this checking:
Maybe this checking should be made in all places mentioned in #489.
The text was updated successfully, but these errors were encountered: