Drop items on entering dead or crit states (#1082)
* Drop items on dead or crit
This commit is contained in:
committed by
GitHub
parent
21c41f28ed
commit
952fa9f7ed
@@ -38,7 +38,7 @@ namespace Content.Server.Mobs
|
||||
.PlayFromEntity(AudioHelpers.GetRandomFileFromSoundCollection("bodyfall"), entity, AudioHelpers.WithVariation(0.25f));
|
||||
|
||||
if(dropItems)
|
||||
DropAllItemsInHands(entity);
|
||||
DropAllItemsInHands(entity, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -61,13 +61,13 @@ namespace Content.Server.Mobs
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void DropAllItemsInHands(IEntity entity)
|
||||
public static void DropAllItemsInHands(IEntity entity, bool doMobChecks = true)
|
||||
{
|
||||
if (!entity.TryGetComponent(out IHandsComponent hands)) return;
|
||||
|
||||
foreach (var heldItem in hands.GetAllHeldItems())
|
||||
{
|
||||
hands.Drop(heldItem.Owner);
|
||||
hands.Drop(heldItem.Owner, doMobChecks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user