@@ -15,24 +15,23 @@ import (
15
15
type Player struct {
16
16
demoInfoProvider demoInfoProvider // provider for demo info such as tick-rate or current tick
17
17
18
- SteamID64 uint64 // 64-bit representation of the user's Steam ID. See https://developer.valvesoftware.com/wiki/SteamID
19
- UserID int // Mostly used in game-events to address this player
20
- Name string // Steam / in-game user name
21
- Inventory map [int ]* Equipment // All weapons / equipment the player is currently carrying. See also Weapons().
22
- AmmoLeft [32 ]int // Ammo left for special weapons (e.g. grenades), index corresponds Equipment.AmmoType
23
- EntityID int // Usually the same as Entity.ID() but may be different between player death and re-spawn.
24
- Entity st.Entity // May be nil between player-death and re-spawn
25
- FlashDuration float32 // Blindness duration from the flashbang currently affecting the player (seconds)
26
- FlashTick int // In-game tick at which the player was last flashed
27
- TeamState * TeamState // When keeping the reference make sure you notice when the player changes teams
28
- Team Team // Team identifier for the player (e.g. TeamTerrorists or TeamCounterTerrorists).
29
- IsBot bool // True if this is a bot-entity. See also IsControllingBot and ControlledBot().
30
- IsConnected bool
31
- IsDefusing bool
32
- IsPlanting bool
33
- IsReloading bool
34
- IsUnknown bool // Used to identify unknown/broken players. see https://github.com/markus-wa/demoinfocs-golang/issues/162
35
- PreviousFramePosition r3.Vector // Deprecated: may be removed in v5 due to performance concerns, track this yourself.
18
+ SteamID64 uint64 // 64-bit representation of the user's Steam ID. See https://developer.valvesoftware.com/wiki/SteamID
19
+ UserID int // Mostly used in game-events to address this player
20
+ Name string // Steam / in-game user name
21
+ Inventory map [int ]* Equipment // All weapons / equipment the player is currently carrying. See also Weapons().
22
+ AmmoLeft [32 ]int // Ammo left for special weapons (e.g. grenades), index corresponds Equipment.AmmoType
23
+ EntityID int // Usually the same as Entity.ID() but may be different between player death and re-spawn.
24
+ Entity st.Entity // May be nil between player-death and re-spawn
25
+ FlashDuration float32 // Blindness duration from the flashbang currently affecting the player (seconds)
26
+ FlashTick int // In-game tick at which the player was last flashed
27
+ TeamState * TeamState // When keeping the reference make sure you notice when the player changes teams
28
+ Team Team // Team identifier for the player (e.g. TeamTerrorists or TeamCounterTerrorists).
29
+ IsBot bool // True if this is a bot-entity. See also IsControllingBot and ControlledBot().
30
+ IsConnected bool
31
+ IsDefusing bool
32
+ IsPlanting bool
33
+ IsReloading bool
34
+ IsUnknown bool // Used to identify unknown/broken players. see https://github.com/markus-wa/demoinfocs-golang/issues/162
36
35
}
37
36
38
37
func (p * Player ) PlayerPawnEntity () st.Entity {
@@ -535,30 +534,6 @@ func (p *Player) PositionEyes() r3.Vector {
535
534
return pos
536
535
}
537
536
538
- // Velocity returns the player's velocity.
539
- func (p * Player ) Velocity () r3.Vector {
540
- if p .demoInfoProvider .IsSource2 () {
541
- t := 64.0
542
- diff := p .Position ().Sub (p .PreviousFramePosition )
543
-
544
- return r3.Vector {
545
- X : diff .X * t ,
546
- Y : diff .Y * t ,
547
- Z : diff .Z * t ,
548
- }
549
- }
550
-
551
- if p .Entity == nil {
552
- return r3.Vector {}
553
- }
554
-
555
- return r3.Vector {
556
- X : float64 (p .Entity .PropertyValueMust ("localdata.m_vecVelocity[0]" ).FloatVal ),
557
- Y : float64 (p .Entity .PropertyValueMust ("localdata.m_vecVelocity[1]" ).FloatVal ),
558
- Z : float64 (p .Entity .PropertyValueMust ("localdata.m_vecVelocity[2]" ).FloatVal ),
559
- }
560
- }
561
-
562
537
// see https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/public/const.h#L146-L188
563
538
const (
564
539
flOnGround = 1 << iota
@@ -825,9 +800,8 @@ type demoInfoProvider interface {
825
800
// Intended for internal use only.
826
801
func NewPlayer (demoInfoProvider demoInfoProvider ) * Player {
827
802
return & Player {
828
- Inventory : make (map [int ]* Equipment ),
829
- demoInfoProvider : demoInfoProvider ,
830
- PreviousFramePosition : r3.Vector {},
803
+ Inventory : make (map [int ]* Equipment ),
804
+ demoInfoProvider : demoInfoProvider ,
831
805
}
832
806
}
833
807
0 commit comments