Skip to content
Open
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
12 changes: 9 additions & 3 deletions EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ public CustomDamageHandler(Player target, BaseHandler baseHandler)
if (Attacker is not null)
{
if (baseHandler is BaseScpDamageHandler)
{
CustomBase = new ScpDamageHandler(target, baseHandler);
else if (Attacker.CurrentItem is not null && Attacker.CurrentItem.Type.IsWeapon() && baseHandler is BaseFirearmHandler)
CustomBase = new FirearmDamageHandler(Attacker.CurrentItem, target, baseHandler);
}
else
CustomBase = new DamageHandler(target, Attacker);
{
Item item = Attacker.CurrentItem;
if (item is not null && item.Type.IsWeapon() && baseHandler is BaseFirearmHandler)
CustomBase = new FirearmDamageHandler(item, target, baseHandler);
else
CustomBase = new DamageHandler(target, Attacker);
}
}
else
{
Expand Down
6 changes: 4 additions & 2 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2014,10 +2014,12 @@ public void DropItem(Item item, bool isThrown = false)
/// <returns>Dropped item's <see cref="Pickup"/>.</returns>
public Pickup DropHeldItem()
{
if (CurrentItem is null)
Item item = CurrentItem;

if (item is null)
return null;

return DropItem(CurrentItem);
return DropItem(item);
}

/// <summary>
Expand Down
Loading