-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
Describe the bug
UniqueID and UniqueID2 aren't unique for different grenades.
I want to use e.Projectile.WeaponInstance.UniqueID2() in events.GrenadeProjectileThrow and e.Grenade.UniqueID2 in events.HeExplode (and similar events) to track grenades over time. Here is my full code: https://github.com/David-Durst/csknow/blob/4e115f7314cb23eb3ba6d4764611731ffe568c3e/demo_parser/internal/parse_tick_data.go#L196-L308
To Reproduce
https://drive.google.com/file/d/1Qv7MoXoEIrA5leIfpzmOk1mRBdtDeqZQ/view?usp=sharing
Code:
lastID := ulid.Make()
p.RegisterEventHandler(func(e events.GrenadeProjectileThrow) {
if lastID == e.Projectile.WeaponInstance.UniqueID2() {
fmt.Printf("duplicate unique ids")
}
lastID = e.Projectile.WeaponInstance.UniqueID2()
})Expected behavior
"duplicate unique ids" should never print.
Instead, there are duplicate ids, so they print out.
Library version
v3.0.2-0.20220908193112-50f55785b7a0
Additional context
Ubuntu 22.04