Skip to content

Commit 573cc6a

Browse files
fix: Fix IsWeapon() did not check for jailbird (#584)
* Jailbird * Update CustomWeapon.cs * Revert "Update CustomWeapon.cs" This reverts commit 4c5e275. * Revert "Jailbird" This reverts commit 56e3d62. * Approve Change Request * Better way --------- Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
1 parent b7df292 commit 573cc6a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ public static class DamageTypeExtensions
124124
/// Check if a <see cref="DamageType">damage type</see> is caused by a weapon.
125125
/// </summary>
126126
/// <param name="type">The damage type to be checked.</param>
127-
/// <param name="checkMicro">Indicates whether the MicroHid damage type should be taken into account.</param>
127+
/// <param name="checkNonFirearm">Indicates whether the MicroHid and Jailbird damage type should be taken into account.</param>
128128
/// <returns>Returns whether the <see cref="DamageType"/> is caused by weapon.</returns>
129-
public static bool IsWeapon(this DamageType type, bool checkMicro = true) => type switch
129+
public static bool IsWeapon(this DamageType type, bool checkNonFirearm = true) => type switch
130130
{
131131
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,
132-
DamageType.MicroHid when checkMicro => true,
132+
DamageType.MicroHid or DamageType.Jailbird when checkNonFirearm => true,
133133
_ => false,
134134
};
135135

EXILED/Exiled.API/Extensions/ItemExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public static class ItemExtensions
3838
/// Check if an <see cref="ItemType">item</see> is a weapon.
3939
/// </summary>
4040
/// <param name="type">The item to be checked.</param>
41-
/// <param name="checkMicro">Indicates whether the MicroHID item should be taken into account.</param>
41+
/// <param name="checkNonFirearm">Indicates whether the MicroHID and Jailbird item should be taken into account.</param>
4242
/// <returns>Returns whether the <see cref="ItemType"/> is a weapon.</returns>
43-
public static bool IsWeapon(this ItemType type, bool checkMicro = true) => type.GetFirearmType() is not FirearmType.None || (checkMicro && type is ItemType.MicroHID);
43+
public static bool IsWeapon(this ItemType type, bool checkNonFirearm = true) => type.GetFirearmType() is not FirearmType.None || (checkNonFirearm && type is ItemType.MicroHID or ItemType.Jailbird);
4444

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

0 commit comments

Comments
 (0)