Skip to content

Commit 76677ef

Browse files
authored
fix: custom weapons not doing default damage when set to below 0 (#518)
* fix custom weapons not doing default damage when set to below 0 * make default damage -1
1 parent 184c51f commit 76677ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override ItemType Type
5252
/// <summary>
5353
/// Gets or sets the weapon damage.
5454
/// </summary>
55-
public virtual float Damage { get; set; } = float.NaN;
55+
public virtual float Damage { get; set; } = -1;
5656

5757
/// <summary>
5858
/// Gets or sets a value indicating how big of a clip the weapon will have.
@@ -205,7 +205,7 @@ protected virtual void OnShot(ShotEventArgs ev)
205205
/// <param name="ev"><see cref="HurtingEventArgs"/>.</param>
206206
protected virtual void OnHurting(HurtingEventArgs ev)
207207
{
208-
if (ev.IsAllowed && Damage != float.NaN)
208+
if (ev.IsAllowed && Damage >= 0)
209209
ev.Amount = Damage;
210210
}
211211

0 commit comments

Comments
 (0)