Reduce MaxBuckleDistance (#5938)
This commit is contained in:
@@ -133,7 +133,7 @@ namespace Content.Server.Buckle.Components
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ownTransform.LocalPosition = Vector2.Zero + strap.BuckleOffset;
|
ownTransform.LocalPosition = strap.BuckleOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanBuckle(EntityUid user, EntityUid to, [NotNullWhen(true)] out StrapComponent? strap)
|
public bool CanBuckle(EntityUid user, EntityUid to, [NotNullWhen(true)] out StrapComponent? strap)
|
||||||
@@ -410,22 +410,5 @@ namespace Content.Server.Buckle.Components
|
|||||||
|
|
||||||
return new BuckleComponentState(Buckled, drawDepth, LastEntityBuckledTo, DontCollide);
|
return new BuckleComponentState(Buckled, drawDepth, LastEntityBuckledTo, DontCollide);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(PhysicsComponent physics)
|
|
||||||
{
|
|
||||||
if (!DontCollide)
|
|
||||||
return;
|
|
||||||
|
|
||||||
physics.WakeBody();
|
|
||||||
|
|
||||||
if (!IsOnStrapEntityThisFrame && DontCollide)
|
|
||||||
{
|
|
||||||
DontCollide = false;
|
|
||||||
TryUnbuckle(Owner);
|
|
||||||
Dirty();
|
|
||||||
}
|
|
||||||
|
|
||||||
IsOnStrapEntityThisFrame = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.ActionBlocker;
|
|
||||||
using Content.Shared.Acts;
|
using Content.Shared.Acts;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Buckle;
|
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
@@ -12,7 +10,6 @@ using Robust.Server.GameObjects;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Players;
|
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -67,7 +64,7 @@ namespace Content.Server.Buckle.Components
|
|||||||
/// Don't change it unless you really have to
|
/// Don't change it unless you really have to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxBuckleDistance", required: false)]
|
[DataField("maxBuckleDistance", required: false)]
|
||||||
public float MaxBuckleDistance = 1f;
|
public float MaxBuckleDistance = 0.1f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// You can specify the offset the entity will have after unbuckling.
|
/// You can specify the offset the entity will have after unbuckling.
|
||||||
|
|||||||
@@ -64,14 +64,6 @@ namespace Content.Server.Buckle.Systems
|
|||||||
args.Handled = component.TryUnbuckle(args.User);
|
args.Handled = component.TryUnbuckle(args.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
|
||||||
{
|
|
||||||
foreach (var (buckle, physics) in EntityManager.EntityQuery<BuckleComponent, PhysicsComponent>())
|
|
||||||
{
|
|
||||||
buckle.Update(physics);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MoveEvent(EntityUid uid, BuckleComponent buckle, ref MoveEvent ev)
|
private void MoveEvent(EntityUid uid, BuckleComponent buckle, ref MoveEvent ev)
|
||||||
{
|
{
|
||||||
var strap = buckle.BuckledTo;
|
var strap = buckle.BuckledTo;
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ namespace Content.Shared.Buckle.Components
|
|||||||
|
|
||||||
public EntityUid? LastEntityBuckledTo { get; set; }
|
public EntityUid? LastEntityBuckledTo { get; set; }
|
||||||
|
|
||||||
public bool IsOnStrapEntityThisFrame { get; set; }
|
|
||||||
|
|
||||||
public bool DontCollide { get; set; }
|
public bool DontCollide { get; set; }
|
||||||
|
|
||||||
public abstract bool TryBuckle(EntityUid user, EntityUid to);
|
public abstract bool TryBuckle(EntityUid user, EntityUid to);
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ namespace Content.Shared.Buckle
|
|||||||
{
|
{
|
||||||
if (args.BodyB.Owner != component.LastEntityBuckledTo) return;
|
if (args.BodyB.Owner != component.LastEntityBuckledTo) return;
|
||||||
|
|
||||||
component.IsOnStrapEntityThisFrame = true;
|
|
||||||
if (component.Buckled || component.DontCollide)
|
if (component.Buckled || component.DontCollide)
|
||||||
{
|
{
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
|
|||||||
Reference in New Issue
Block a user