demoinfocs-golang icon indicating copy to clipboard operation
demoinfocs-golang copied to clipboard

crashed at Player.EquipmentValueFreezeTimeEnd()

Open penjiu opened this issue 2 years ago • 2 comments

Describe the bug Failed to get equipment value at specified round(round 12), and the program crashes.

To Reproduce demo url: https://pvp-demo-hz.oss-cn-hangzhou.aliyuncs.com/demo/normal/9205806215538562956_0.dem?response-content-disposition=attachment%3Bfilename%3D9205806215538562956_0.dem.zip&OSSAccessKeyId=LTAI4FdozZjF98JnnYvJRUeQ&Expires=1699328617&Signature=L09sAXWFLY3RlcszNOZsjHlTcXc%3D

  1. Register WeaponFire event
  2. 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

penjiu avatar Oct 08 '23 03:10 penjiu

thanks - I will try to look into it when I find some time

markus-wa avatar Oct 14 '23 15:10 markus-wa

Hi guys, is there a chance to look into this issue ?

penjiu avatar Dec 15 '23 08:12 penjiu