Skip to content

Commit 7a65748

Browse files
committed
sendtables: remove Entity.BindPosition() and PropertyValue.Float64Val()
1 parent d967d90 commit 7a65748

File tree

4 files changed

+3
-23
lines changed

4 files changed

+3
-23
lines changed

pkg/demoinfocs/common/player.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ func (p *Player) Velocity() r3.Vector {
278278
}
279279

280280
return r3.Vector{
281-
X: p.Entity.PropertyValueMust("localdata.m_vecVelocity[0]").Float64Val(),
282-
Y: p.Entity.PropertyValueMust("localdata.m_vecVelocity[1]").Float64Val(),
283-
Z: p.Entity.PropertyValueMust("localdata.m_vecVelocity[2]").Float64Val(),
281+
X: float64(p.Entity.PropertyValueMust("localdata.m_vecVelocity[0]").FloatVal),
282+
Y: float64(p.Entity.PropertyValueMust("localdata.m_vecVelocity[1]").FloatVal),
283+
Z: float64(p.Entity.PropertyValueMust("localdata.m_vecVelocity[2]").FloatVal),
284284
}
285285
}
286286

pkg/demoinfocs/sendtables/entity.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,6 @@ func (e *entity) OnPositionUpdate(h func(pos r3.Vector)) {
271271
}
272272
}
273273

274-
// BindPosition binds the entity's position to a pointer variable.
275-
// The pointer is updated every time a position-relevant property is updated.
276-
//
277-
// See also OnPositionUpdate()
278-
func (e *entity) BindPosition(pos *r3.Vector) {
279-
e.OnPositionUpdate(func(newPos r3.Vector) {
280-
*pos = newPos
281-
})
282-
}
283-
284274
// Returns a coordinate from a cell + offset
285275
func coordFromCell(cell, cellWidth int, offset float64) float64 {
286276
return float64(cell*cellWidth-maxCoordInt) + offset

pkg/demoinfocs/sendtables/entity_interface.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ type Entity interface {
4444
//
4545
// See also Position()
4646
OnPositionUpdate(h func(pos r3.Vector))
47-
// BindPosition binds the entity's position to a pointer variable.
48-
// The pointer is updated every time a position-relevant property is updated.
49-
//
50-
// See also OnPositionUpdate()
51-
BindPosition(pos *r3.Vector)
5247
// OnDestroy registers a function to be called on the entity's destruction.
5348
OnDestroy(delegate func())
5449
// Destroy triggers all via OnDestroy() registered functions.

pkg/demoinfocs/sendtables/propdecoder.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ func (v PropertyValue) BoolVal() bool {
8585
return v.IntVal > 0
8686
}
8787

88-
// Float64Val returns FloatVal converted from float32 to float64.
89-
func (v PropertyValue) Float64Val() float64 {
90-
return float64(v.FloatVal)
91-
}
92-
9388
type propertyDecoder struct{}
9489

9590
func (propertyDecoder) decodeProp(prop *property, reader *bit.BitReader) {

0 commit comments

Comments
 (0)