kakozuzo/Code/swb_base/Weapon.Attachments.cs

18 lines
328 B
C#
Raw Normal View History

2024-10-30 19:01:58 +03:00
using SWB.Base.Attachments;
namespace SWB.Base;
public partial class Weapon
{
public Attachment GetActiveAttachmentForCategory( AttachmentCategory category )
{
foreach ( var attachment in Attachments )
{
if ( attachment.Category == category && attachment.Equipped )
return attachment;
}
return null;
}
}