Replace AttachToGridOrMap with DropNextTo (#27950)

This commit is contained in:
ShadowCommander
2024-05-12 07:30:17 -07:00
committed by GitHub
parent 1596e04d0f
commit 8938e1d8b2
3 changed files with 11 additions and 28 deletions

View File

@@ -322,15 +322,17 @@ public partial class SharedBodySystem
launchImpulseVariance:GibletLaunchImpulseVariance, launchCone: splatCone);
}
}
var bodyTransform = Transform(bodyId);
if (TryComp<InventoryComponent>(bodyId, out var inventory))
{
foreach (var item in _inventory.GetHandOrInventoryEntities(bodyId))
{
SharedTransform.AttachToGridOrMap(item);
SharedTransform.DropNextTo(item, (bodyId, bodyTransform));
gibs.Add(item);
}
}
_audioSystem.PlayPredicted(gibSoundOverride, Transform(bodyId).Coordinates, null);
_audioSystem.PlayPredicted(gibSoundOverride, bodyTransform.Coordinates, null);
return gibs;
}
}