Skip to content

Commit 5b10e5e

Browse files
committed
Added Silenced() to equipment
1 parent 28a80ab commit 5b10e5e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/demoinfocs/common/equipment.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,18 @@ func (e *Equipment) RecoilIndex() float32 {
444444
return val.Float()
445445
}
446446

447+
// Silenced returns true if weapon is silenced.
448+
func (e *Equipment) Silenced() bool {
449+
// If entity is nil returns false.
450+
if e.Entity == nil {
451+
return false
452+
}
453+
454+
prop := e.Entity.Property("m_bSilencerOn")
455+
456+
return prop.Value().BoolVal()
457+
}
458+
447459
// NewEquipment creates a new Equipment and sets the UniqueID.
448460
//
449461
// Intended for internal use only.

0 commit comments

Comments
 (0)