Skip to content

Commit 1893f9e

Browse files
committed
remove deprecated Player.LastAlivePosition due to performance concerns
1 parent b550bd3 commit 1893f9e

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

pkg/demoinfocs/common/player.go

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ type Player struct {
1616
demoInfoProvider demoInfoProvider // provider for demo info such as tick-rate or current tick
1717

1818
SteamID64 uint64 // 64-bit representation of the user's Steam ID. See https://developer.valvesoftware.com/wiki/SteamID
19-
LastAlivePosition r3.Vector // Deprecated: will be removed in v5 due to performance concerns, track this yourself.
2019
UserID int // Mostly used in game-events to address this player
2120
Name string // Steam / in-game user name
2221
Inventory map[int]*Equipment // All weapons / equipment the player is currently carrying. See also Weapons().

pkg/demoinfocs/datatables.go

-19
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,6 @@ func (p *parser) bindNewPlayerS1(playerEntity st.Entity) {
478478
pl.Entity = nil
479479
})
480480

481-
// Position
482-
playerEntity.OnPositionUpdate(func(pos r3.Vector) {
483-
if pl.IsAlive() {
484-
pl.LastAlivePosition = pos
485-
}
486-
})
487-
488481
// General info
489482
playerEntity.Property("m_iTeamNum").OnUpdate(func(val st.PropertyValue) {
490483
pl.Team = common.Team(val.IntVal)
@@ -632,18 +625,6 @@ func (p *parser) bindNewPlayerPawnS2(pawnEntity st.Entity) {
632625
p.bindPlayerWeaponsS2(pawnEntity, pl)
633626
})
634627

635-
// Position
636-
pawnEntity.OnPositionUpdate(func(pos r3.Vector) {
637-
pl := getPlayerFromPawnEntity(pawnEntity)
638-
if pl == nil {
639-
return
640-
}
641-
642-
if pl.IsAlive() {
643-
pl.LastAlivePosition = pos
644-
}
645-
})
646-
647628
pawnEntity.Property("m_flFlashDuration").OnUpdate(func(val st.PropertyValue) {
648629
pl := getPlayerFromPawnEntity(pawnEntity)
649630
if pl == nil {

0 commit comments

Comments
 (0)