Skip to content

Commit 4609a93

Browse files
committed
events: remove deprecated PlayerFlashed.Weapon
1 parent 2e5a142 commit 4609a93

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/nade-trajectories/nade_trajectories.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func main() {
6565

6666
if nadeTrajectories[id] == nil {
6767
nadeTrajectories[id] = &nadePath{
68-
wep: e.Projectile.Weapon,
68+
wep: e.Projectile.WeaponInstance.Type,
6969
team: team,
7070
}
7171
}

pkg/demoinfocs/game_events.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,11 @@ func (geh gameEventHandler) playerBlind(data map[string]*msg.CSVCMsg_GameEventKe
346346

347347
if projectile != nil {
348348
unassert.Samef(attacker, projectile.Thrower, "PlayerFlashed.Attacker != PlayerFlashed.Projectile.Thrower")
349-
unassert.Samef(projectile.Weapon, common.EqFlash, "PlayerFlashed.Projectile.Weapon != EqFlash")
349+
unassert.NotNilf(projectile.WeaponInstance, "WeaponInstance == nil")
350+
351+
if projectile.WeaponInstance != nil {
352+
unassert.Samef(projectile.WeaponInstance.Type, common.EqFlash, "PlayerFlashed.Projectile.Weapon != EqFlash")
353+
}
350354
}
351355

352356
geh.dispatch(events.PlayerFlashed{

0 commit comments

Comments
 (0)