Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/demoinfocs/common/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ func (p *Player) Weapons() []*Equipment {
return res
}

// FlashbangCount returns the amount of flashbangs the player currently has in his inventory.
func (p *Player) FlashbangCount() uint64 {
pawn := p.PlayerPawnEntity()
if pawn == nil {
return 0
}

flashCountProp, ok := pawn.PropertyValue("m_pWeaponServices.m_iAmmo.0014")
if !ok {
return 0
}

return flashCountProp.UInt64()
}

// IsSpottedBy returns true if the player has been spotted by the other player.
// This is NOT "Line of Sight" / FOV - look up "CSGO TraceRay" for that.
// May not behave as expected with multiple spotters.
Expand Down
Binary file added pkg/demoinfocs/event-list-dump/14089.bin
Binary file not shown.
5 changes: 4 additions & 1 deletion pkg/demoinfocs/s2_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,11 @@ func getGameEventListBinForProtocol(networkProtocol int) ([]byte, error) {
case networkProtocol < 14069:
return eventListFolder.ReadFile("event-list-dump/14023.bin")

default:
case networkProtocol < 14089:
return eventListFolder.ReadFile("event-list-dump/14070.bin")

default:
return eventListFolder.ReadFile("event-list-dump/14089.bin")
}
}

Expand Down
Loading