Skip to content

Commit

Permalink
remove deprecated Player.LastAlivePosition due to performance concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-wa committed Sep 4, 2024
1 parent bfd852d commit 3e6101c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion pkg/demoinfocs/common/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Player struct {
demoInfoProvider demoInfoProvider // provider for demo info such as tick-rate or current tick

SteamID64 uint64 // 64-bit representation of the user's Steam ID. See https://developer.valvesoftware.com/wiki/SteamID
LastAlivePosition r3.Vector // Deprecated: will be removed in v5 due to performance concerns, track this yourself.
UserID int // Mostly used in game-events to address this player
Name string // Steam / in-game user name
Inventory map[int]*Equipment // All weapons / equipment the player is currently carrying. See also Weapons().
Expand Down
19 changes: 0 additions & 19 deletions pkg/demoinfocs/datatables.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,6 @@ func (p *parser) bindNewPlayerS1(playerEntity st.Entity) {
pl.Entity = nil
})

// Position
playerEntity.OnPositionUpdate(func(pos r3.Vector) {
if pl.IsAlive() {
pl.LastAlivePosition = pos
}
})

// General info
playerEntity.Property("m_iTeamNum").OnUpdate(func(val st.PropertyValue) {
pl.Team = common.Team(val.IntVal)
Expand Down Expand Up @@ -632,18 +625,6 @@ func (p *parser) bindNewPlayerPawnS2(pawnEntity st.Entity) {
p.bindPlayerWeaponsS2(pawnEntity, pl)
})

// Position
pawnEntity.OnPositionUpdate(func(pos r3.Vector) {
pl := getPlayerFromPawnEntity(pawnEntity)
if pl == nil {
return
}

if pl.IsAlive() {
pl.LastAlivePosition = pos
}
})

pawnEntity.Property("m_flFlashDuration").OnUpdate(func(val st.PropertyValue) {
pl := getPlayerFromPawnEntity(pawnEntity)
if pl == nil {
Expand Down

0 comments on commit 3e6101c

Please sign in to comment.