dotabuff / yasha

Dota 2 (Source 1) replay parser written in Go
MIT License
132 stars 19 forks source link

Add tick parameter to OnCombatLog hook #8

Closed mzuber closed 9 years ago

mzuber commented 9 years ago

Currently there is no reliable method to get the exact tick a combat log event occurred. The Time and TimeRaw fields in the different combat log messages cannot be used for this, there seems to be some magical offset which differs in every replay. Fortunately, the function calling the OnCombatLog hook (onGameEvent) does know the tick at which the game event message containing the combat log message was sent. Simply passing this tick to the OnCombatLog call (and changing the signature of this hook accordingly) would supply the exact tick for every combat log message.