Skip to content

Commit 42c7b7e

Browse files
committed
linting fixes
1 parent f6a5b79 commit 42c7b7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/demoinfocs/datatables.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,17 +689,20 @@ func (p *parser) bindPlayerWeapons(playerEntity st.Entity, pl *common.Player) {
689689

690690
func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
691691
const inventoryCapacity = 64
692+
692693
var inventorySize uint64 = 64
693694

694695
type eq struct {
695696
*common.Equipment
696697
entityID int
697698
}
699+
698700
playerInventory := make(map[int]eq)
699701

700702
getWep := func(wepSlotPropertyValue st.PropertyValue) (uint64, *common.Equipment) {
701703
entityID := wepSlotPropertyValue.S2UInt64() & constants.EntityHandleIndexMaskSource2
702704
wep := p.gameState.weapons[int(entityID)]
705+
703706
if wep == nil {
704707
// sometimes a weapon is assigned to a player before the weapon entity is created
705708
wep = common.NewEquipment(common.EqUnknown)
@@ -711,6 +714,7 @@ func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
711714

712715
setPlayerInventory := func() {
713716
inventory := make(map[int]*common.Equipment, inventorySize)
717+
714718
for i := uint64(0); i < inventorySize; i++ {
715719
val := pawnEntity.Property(playerWeaponPrefixS2 + fmt.Sprintf("%04d", i)).Value()
716720
if val.Any == nil {
@@ -720,6 +724,7 @@ func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
720724
entityID, wep := getWep(val)
721725
inventory[int(entityID)] = wep
722726
}
727+
723728
pl.Inventory = inventory
724729
}
725730

@@ -759,6 +764,7 @@ func (p *parser) bindPlayerWeaponsS2(pawnEntity st.Entity, pl *common.Player) {
759764
setPlayerInventory()
760765
}
761766
}
767+
762768
property := pawnEntity.Property(playerWeaponPrefixS2 + fmt.Sprintf("%04d", i))
763769
updateWeapon(property.Value())
764770
property.OnUpdate(updateWeapon)

0 commit comments

Comments
 (0)