Fix not dropping your items when dying while buckled (#1856)

* Fix not dropping your items when dying while buckled

* Add test for dropping items while buckled and dead
This commit is contained in:
DrSmugleaf
2020-08-22 17:07:41 +02:00
committed by GitHub
parent 092dd7c946
commit 7e957ceff1
3 changed files with 98 additions and 5 deletions

View File

@@ -21,6 +21,11 @@ namespace Content.Server.Mobs
/// <returns>False if the mob was already downed or couldn't set the state</returns>
public static bool Down(IEntity entity, bool playSound = true, bool dropItems = true, bool force = false)
{
if (dropItems)
{
DropAllItemsInHands(entity, false);
}
if (!force && !EffectBlockerSystem.CanFall(entity))
{
return false;
@@ -45,11 +50,6 @@ namespace Content.Server.Mobs
.PlayFromEntity(AudioHelpers.GetRandomFileFromSoundCollection("bodyfall"), entity, AudioHelpers.WithVariation(0.25f));
}
if(dropItems)
{
DropAllItemsInHands(entity, false);
}
return true;
}