Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ public static class DamageTypeExtensions
/// Check if a <see cref="DamageType">damage type</see> is caused by a weapon.
/// </summary>
/// <param name="type">The damage type to be checked.</param>
/// <param name="checkMicro">Indicates whether the MicroHid damage type should be taken into account.</param>
/// <param name="checkNonFirearm">Indicates whether the MicroHid and Jailbird damage type should be taken into account.</param>
/// <returns>Returns whether the <see cref="DamageType"/> is caused by weapon.</returns>
public static bool IsWeapon(this DamageType type, bool checkMicro = true) => type switch
public static bool IsWeapon(this DamageType type, bool checkNonFirearm = true) => type switch
{
DamageType.Crossvec or DamageType.Logicer or DamageType.Revolver or DamageType.Shotgun or DamageType.AK or DamageType.Com15 or DamageType.Com18 or DamageType.E11Sr or DamageType.Fsp9 or DamageType.ParticleDisruptor or DamageType.Com45 or DamageType.Frmg0 or DamageType.A7 => true,
DamageType.MicroHid when checkMicro => true,
DamageType.MicroHid or DamageType.Jailbird when checkNonFirearm => true,
_ => false,
};

Expand Down
4 changes: 2 additions & 2 deletions EXILED/Exiled.API/Extensions/ItemExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static class ItemExtensions
/// Check if an <see cref="ItemType">item</see> is a weapon.
/// </summary>
/// <param name="type">The item to be checked.</param>
/// <param name="checkMicro">Indicates whether the MicroHID item should be taken into account.</param>
/// <param name="checkNonFirearm">Indicates whether the MicroHID and Jailbird item should be taken into account.</param>
/// <returns>Returns whether the <see cref="ItemType"/> is a weapon.</returns>
public static bool IsWeapon(this ItemType type, bool checkMicro = true) => type.GetFirearmType() is not FirearmType.None || (checkMicro && type is ItemType.MicroHID);
public static bool IsWeapon(this ItemType type, bool checkNonFirearm = true) => type.GetFirearmType() is not FirearmType.None || (checkNonFirearm && type is ItemType.MicroHID or ItemType.Jailbird);

/// <summary>
/// Check if an <see cref="ItemType">item</see> is an SCP.
Expand Down