Skip to content

Commit

Permalink
fix crash if other_death entity doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-wa committed Oct 18, 2023
1 parent 665d2c6 commit 7be9c51
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/demoinfocs/game_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,14 @@ func (geh gameEventHandler) otherDeath(data map[string]*msg.CSVCMsg_GameEventKey
killer := geh.playerByUserID32(data["attacker"].GetValShort())
otherType := data["othertype"].GetValString()
otherID := data["otherid"].GetValShort()
otherPosition := geh.gameState().entities[int(otherID)].Position()
other := geh.gameState().entities[int(otherID)]

var otherPosition r3.Vector

if other != nil {
otherPosition = other.Position()
}

wepType := common.MapEquipment(data["weapon"].GetValString())
weapon := getPlayerWeapon(killer, wepType)

Expand Down

0 comments on commit 7be9c51

Please sign in to comment.