@@ -4,10 +4,10 @@ import (
44 "fmt"
55 "strings"
66
7- r3 "github.com/golang/geo/r3"
7+ "github.com/golang/geo/r3"
88
9- common "github.com/markus-wa/demoinfocs-golang/common"
10- events "github.com/markus-wa/demoinfocs-golang/events"
9+ "github.com/markus-wa/demoinfocs-golang/common"
10+ "github.com/markus-wa/demoinfocs-golang/events"
1111 st "github.com/markus-wa/demoinfocs-golang/sendtables"
1212)
1313
@@ -220,7 +220,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
220220 })
221221
222222 // General info
223- playerEntity .FindProperty ("m_iTeamNum" ).OnUpdate (func (val st.PropertyValue ) {
223+ playerEntity .FindPropertyI ("m_iTeamNum" ).OnUpdate (func (val st.PropertyValue ) {
224224 pl .Team = common .Team (val .IntVal ) // Need to cast to team so we can't use BindProperty
225225 pl .TeamState = p .gameState .Team (pl .Team )
226226 })
@@ -233,7 +233,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
233233
234234 playerEntity .BindProperty ("m_angEyeAngles[1]" , & pl .ViewDirectionX , st .ValTypeFloat32 )
235235 playerEntity .BindProperty ("m_angEyeAngles[0]" , & pl .ViewDirectionY , st .ValTypeFloat32 )
236- playerEntity .FindProperty ("m_flFlashDuration" ).OnUpdate (func (val st.PropertyValue ) {
236+ playerEntity .FindPropertyI ("m_flFlashDuration" ).OnUpdate (func (val st.PropertyValue ) {
237237 if val .FloatVal == 0 {
238238 pl .FlashTick = 0
239239 } else {
@@ -254,7 +254,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
254254
255255 // Some demos have an additional prefix for player weapons weapon
256256 var wepPrefix string
257- if playerEntity .FindProperty (playerWeaponPrefix + "000" ) != nil {
257+ if playerEntity .FindPropertyI (playerWeaponPrefix + "000" ) != nil {
258258 wepPrefix = playerWeaponPrefix
259259 } else {
260260 wepPrefix = playerWeaponPrePrefix + playerWeaponPrefix
@@ -264,7 +264,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
264264 var cache [maxWeapons ]int
265265 for i := range cache {
266266 i2 := i // Copy for passing to handler
267- playerEntity .FindProperty (wepPrefix + fmt .Sprintf ("%03d" , i )).OnUpdate (func (val st.PropertyValue ) {
267+ playerEntity .FindPropertyI (wepPrefix + fmt .Sprintf ("%03d" , i )).OnUpdate (func (val st.PropertyValue ) {
268268 entityID := val .IntVal & entityHandleIndexMask
269269 if entityID != entityHandleIndexMask {
270270 if cache [i2 ] != 0 {
@@ -289,7 +289,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
289289 }
290290
291291 // Active weapon
292- playerEntity .FindProperty ("m_hActiveWeapon" ).OnUpdate (func (val st.PropertyValue ) {
292+ playerEntity .FindPropertyI ("m_hActiveWeapon" ).OnUpdate (func (val st.PropertyValue ) {
293293 pl .ActiveWeaponID = val .IntVal & entityHandleIndexMask
294294 })
295295
@@ -298,7 +298,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
298298 playerEntity .BindProperty ("m_iAmmo." + fmt .Sprintf ("%03d" , i2 ), & pl .AmmoLeft [i2 ], st .ValTypeInt )
299299 }
300300
301- playerEntity .FindProperty ("m_bIsDefusing" ).OnUpdate (func (val st.PropertyValue ) {
301+ playerEntity .FindPropertyI ("m_bIsDefusing" ).OnUpdate (func (val st.PropertyValue ) {
302302 if p .gameState .currentDefuser == pl && pl .IsDefusing && val .IntVal == 0 {
303303 p .eventDispatcher .Dispatch (events.BombDefuseAborted {Player : pl })
304304 p .gameState .currentDefuser = nil
0 commit comments