Skip to content

Duplicate UniqueID/UniqueID2 For Tracking Grenades Over Time #361

@David-Durst

Description

@David-Durst

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions