[STAGING/HOTFIX] Butcher entities in containers. (#40299)
* Kitchen spike and sharp system * Use transform and parent * A * Works * A --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9e204c3023
commit
d8e818283c
@@ -102,19 +102,25 @@ public sealed class SharpSystem : EntitySystem
|
||||
|
||||
component.Butchering.Remove(args.Args.Target.Value);
|
||||
|
||||
if (_containerSystem.IsEntityInContainer(args.Args.Target.Value))
|
||||
{
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var spawnEntities = EntitySpawnCollection.GetSpawns(butcher.SpawnedEntities, _robustRandom);
|
||||
var coords = _transform.GetMapCoordinates(args.Args.Target.Value);
|
||||
EntityUid popupEnt = default!;
|
||||
foreach (var proto in spawnEntities)
|
||||
|
||||
if (_containerSystem.TryGetContainingContainer(args.Args.Target.Value, out var container))
|
||||
{
|
||||
// distribute the spawned items randomly in a small radius around the origin
|
||||
popupEnt = Spawn(proto, coords.Offset(_robustRandom.NextVector2(0.25f)));
|
||||
foreach (var proto in spawnEntities)
|
||||
{
|
||||
// distribute the spawned items randomly in a small radius around the origin
|
||||
popupEnt = SpawnInContainerOrDrop(proto, container.Owner, container.ID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var proto in spawnEntities)
|
||||
{
|
||||
// distribute the spawned items randomly in a small radius around the origin
|
||||
popupEnt = Spawn(proto, coords.Offset(_robustRandom.NextVector2(0.25f)));
|
||||
}
|
||||
}
|
||||
|
||||
// only show a big popup when butchering living things.
|
||||
|
||||
Reference in New Issue
Block a user