/// </summary>
public sealed class ItemPlacerSystem : EntitySystem
{
+ [Dependency] private readonly CollisionWakeSystem _wake = default!;
[Dependency] private readonly PlaceableSurfaceSystem _placeableSurface = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
if (comp.Whitelist != null && !comp.Whitelist.IsValid(args.OtherEntity))
return;
- // Disallow sleeping so we can detect when entity is removed from the heater.
- _physics.SetSleepingAllowed(args.OtherEntity, args.OtherBody, false);
+ if (TryComp<CollisionWakeComponent>(uid, out var wakeComp))
+ _wake.SetEnabled(uid, false, wakeComp);
var count = comp.PlacedEntities.Count;
if (comp.MaxEntities == 0 || count < comp.MaxEntities)
private void OnEndCollide(EntityUid uid, ItemPlacerComponent comp, ref EndCollideEvent args)
{
- // Re-allow sleeping.
- _physics.SetSleepingAllowed(args.OtherEntity, args.OtherBody, true);
+ if (TryComp<CollisionWakeComponent>(uid, out var wakeComp))
+ _wake.SetEnabled(uid, true, wakeComp);
comp.PlacedEntities.Remove(args.OtherEntity);