Skip to content

Commit

Permalink
webedit jumpscare 2
Browse files Browse the repository at this point in the history
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Signed-off-by: Eris <[email protected]>
  • Loading branch information
Erisfiregamer1 authored Nov 24, 2024
1 parent 3c0d4a0 commit 34540e5
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion Content.Shared/Nyanotrasen/Kitchen/SharedDeepfryerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
namespace Content.Shared.Nyanotrasen.Kitchen;
using Content.Shared.DragDrop;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
using Content.Shared.Nyanotrasen.Kitchen.Components;
using Content.Shared.Item;
using Content.Shared.Body.Components;

namespace Content.Shared.Nyanotrasen.Kitchen;

public abstract class SharedDeepfryerSystem : EntitySystem
{
protected void OnCanDragDropOn(EntityUid uid, SharedDeepFryerComponent component, ref CanDropTargetEvent args)
{
if (args.Handled)
return;

args.CanDrop = CanInsert(uid, args.Dragged);
args.Handled = true;
}

public virtual bool CanInsert(EntityUid uid, EntityUid entity)
{
if (!Transform(uid).Anchored)
return false;

var storable = HasComp<ItemComponent>(entity);
if (!storable && !HasComp<BodyComponent>(entity))
return false;

if (TryComp<PhysicsComponent>(entity, out var physics) && (physics.CanCollide) || storable)
return true;
else
return false;

}
}

0 comments on commit 34540e5

Please sign in to comment.