We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cdb3cd commit f0b5a7eCopy full SHA for f0b5a7e
pkg/demoinfocs/common/equipment.go
@@ -417,7 +417,7 @@ func (e *Equipment) AmmoReserve() int {
417
}
418
419
s2Prop := e.Entity.Property("m_pReserveAmmo.0000")
420
- if s2Prop != nil {
+ if s2Prop != nil && s2Prop.Value().Any != nil {
421
return s2Prop.Value().Int()
422
423
@@ -430,9 +430,17 @@ func (e *Equipment) AmmoReserve() int {
430
return 0
431
432
433
+ if e.Class() == EqClassEquipment {
434
+ return 0
435
+ }
436
+
437
// if the property doesn't exist we return 0 by default
438
val, _ := e.Entity.PropertyValue("m_iPrimaryReserveAmmoCount")
439
440
+ if val.Any == nil {
441
442
443
444
return val.IntVal
445
446
0 commit comments