Crazy Glue Fix (#17262)
This commit is contained in:
@@ -39,11 +39,9 @@ namespace Content.Server.Glue
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (HasComp<ItemComponent>(target))
|
if (HasComp<ItemComponent>(target))
|
||||||
{
|
{
|
||||||
_audio.PlayPvs(component.Squeeze, uid);
|
_audio.PlayPvs(component.Squeeze, uid);
|
||||||
EnsureComp<UnremoveableComponent>(target);
|
|
||||||
_popup.PopupEntity(Loc.GetString("glue-success", ("target", Identity.Entity(target, EntityManager))), args.User,
|
_popup.PopupEntity(Loc.GetString("glue-success", ("target", Identity.Entity(target, EntityManager))), args.User,
|
||||||
args.User, PopupType.Medium);
|
args.User, PopupType.Medium);
|
||||||
EnsureComp<GluedComponent>(target);
|
EnsureComp<GluedComponent>(target);
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
using Content.Shared.Interaction.Components;
|
using Content.Shared.Interaction.Components;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Content.Shared.Interaction;
|
|
||||||
using Content.Shared.Glue;
|
using Content.Shared.Glue;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands;
|
||||||
|
|
||||||
namespace Content.Server.Glue;
|
namespace Content.Server.Glue;
|
||||||
|
|
||||||
@@ -16,7 +15,7 @@ public sealed class GluedSystem : EntitySystem
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<GluedComponent, ComponentInit>(OnGluedInit);
|
SubscribeLocalEvent<GluedComponent, ComponentInit>(OnGluedInit);
|
||||||
SubscribeLocalEvent<GluedComponent, InteractHandEvent>(OnPickUp);
|
SubscribeLocalEvent<GluedComponent, GotEquippedHandEvent>(OnHandPickUp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timing to remove glued and unremoveable.
|
// Timing to remove glued and unremoveable.
|
||||||
@@ -52,13 +51,10 @@ public sealed class GluedSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Timers start only when the glued item is picked up.
|
// Timers start only when the glued item is picked up.
|
||||||
private void OnPickUp(EntityUid uid, GluedComponent component, InteractHandEvent args)
|
private void OnHandPickUp(EntityUid uid, GluedComponent component, GotEquippedHandEvent args)
|
||||||
{
|
{
|
||||||
var userHands = Comp<HandsComponent>(args.User);
|
EnsureComp<UnremoveableComponent>(uid);
|
||||||
if (userHands.ActiveHandEntity == uid)
|
component.GlueBroken = true;
|
||||||
{
|
component.GlueTime = _timing.CurTime + component.GlueCooldown;
|
||||||
component.GlueBroken = true;
|
|
||||||
component.GlueTime = _timing.CurTime + component.GlueCooldown;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user