parent
c5c99151aa
commit
6abe63cf9e
1 changed files with 18 additions and 1 deletions
|
|
@ -45,10 +45,26 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
|
|||
|
||||
SubscribeLocalEvent<TetheredComponent, BuckleAttemptEvent>(OnTetheredBuckleAttempt);
|
||||
SubscribeLocalEvent<TetheredComponent, UpdateCanMoveEvent>(OnTetheredUpdateCanMove);
|
||||
SubscribeLocalEvent<TetheredComponent, EntGotInsertedIntoContainerMessage>(OnTetheredContainerInserted);
|
||||
|
||||
InitializeForce();
|
||||
}
|
||||
|
||||
private void OnTetheredContainerInserted(EntityUid uid, TetheredComponent component, EntGotInsertedIntoContainerMessage args)
|
||||
{
|
||||
if (TryComp<TetherGunComponent>(component.Tetherer, out var tetherGun))
|
||||
{
|
||||
StopTether(component.Tetherer, tetherGun);
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryComp<ForceGunComponent>(component.Tetherer, out var forceGun))
|
||||
{
|
||||
StopTether(component.Tetherer, forceGun);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTetheredBuckleAttempt(EntityUid uid, TetheredComponent component, ref BuckleAttemptEvent args)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
|
|
@ -152,7 +168,8 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
|
|||
if (HasComp<TetheredComponent>(target) || !TryComp<PhysicsComponent>(target, out var physics))
|
||||
return false;
|
||||
|
||||
if (physics.BodyType == BodyType.Static && !component.CanUnanchor)
|
||||
if (physics.BodyType == BodyType.Static && !component.CanUnanchor ||
|
||||
_container.IsEntityInContainer(target))
|
||||
return false;
|
||||
|
||||
if (physics.Mass > component.MassLimit)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue