Closed
Description
Describe the bug
Failed to get equipment value at specified round(round 12), and the program crashes.
- Register WeaponFire event
- call Player.EquipmentValueFreezeTimeEnd()
Code:
parser.RegisterEventHandler(func(e events.WeaponFire) {
a.HandleWeaponFired(parser, e)
})
func (a *Analyzer) HandleWeaponFired(parser dem.Parser, e events.WeaponFire) {
equipmentValueCt := int(0)
equipmentValueT := int(0)
for _, participant := range parser.GameState().Participants().All() {
if participant.Team == common.TeamCounterTerrorists {
equipmentValueCt += participant.EquipmentValueFreezeTimeEnd()
} else if participant.Team == common.TeamTerrorists {
equipmentValueT += participant.EquipmentValueFreezeTimeEnd()
}
}
}
Expected behavior
Player.EquipmentValueFreezeTimeEnd() returns correct equipment value.
Library version
v4.0.0-beta.2