@@ -709,17 +709,17 @@ const maxWeapons = 64
709709func (p * parser ) bindPlayerWeapons (playerEntity st.Entity , pl * common.Player ) {
710710 // Some demos have an additional prefix for player weapons weapon
711711 var wepPrefix string
712- if playerEntity .Property (playerWeaponPrefix + "000" ) != nil {
712+ if playerEntity .Property (playerWeaponPrefix + ". 000" ) != nil {
713713 wepPrefix = playerWeaponPrefix
714714 } else {
715- wepPrefix = playerWeaponPrePrefix + playerWeaponPrefix
715+ wepPrefix = "bcc_nonlocaldata." + playerWeaponPrefix
716716 }
717717
718718 // Weapons
719719 var cache [maxWeapons ]int
720720 for i := range cache {
721721 i2 := i // Copy for passing to handler
722- playerEntity .Property (wepPrefix + fmt .Sprintf ("%03d" , i )).OnUpdate (func (val st.PropertyValue ) {
722+ playerEntity .Property (wepPrefix + fmt .Sprintf (". %03d" , i )).OnUpdate (func (val st.PropertyValue ) {
723723 entityID := val .IntVal & constants .EntityHandleIndexMask
724724 if entityID != constants .EntityHandleIndexMask {
725725 if cache [i2 ] != 0 {
@@ -785,7 +785,7 @@ func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
785785 inventory := make (map [int ]* common.Equipment , inventorySize )
786786
787787 for i := 0 ; i < inventorySize ; i ++ {
788- val := pawnEntity .Property (playerWeaponPrefixS2 + fmt .Sprintf ("%04d" , i )).Value ()
788+ val := pawnEntity .Property (playerWeaponPrefixS2 + fmt .Sprintf (". %04d" , i )).Value ()
789789 if val .Any == nil {
790790 continue
791791 }
@@ -797,7 +797,7 @@ func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
797797 pl .Inventory = inventory
798798 }
799799
800- pawnEntity .Property ("m_pWeaponServices.m_hMyWeapons" ).OnUpdate (func (pv st.PropertyValue ) {
800+ pawnEntity .Property (playerWeaponPrefixS2 ).OnUpdate (func (pv st.PropertyValue ) {
801801 inventorySize = len (pv .S2Array ())
802802 setPlayerInventory ()
803803 })
@@ -834,7 +834,7 @@ func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
834834 }
835835 }
836836
837- property := pawnEntity .Property (playerWeaponPrefixS2 + fmt .Sprintf ("%04d" , i ))
837+ property := pawnEntity .Property (playerWeaponPrefixS2 + fmt .Sprintf (". %04d" , i ))
838838 updateWeapon (property .Value ())
839839 property .OnUpdate (updateWeapon )
840840 }
0 commit comments