Reduce MaxBuckleDistance (#5938)

This commit is contained in:
metalgearsloth
2021-12-29 23:14:21 +11:00
committed by GitHub
parent 45bfc0b96b
commit 39e42899ca
5 changed files with 2 additions and 33 deletions

View File

@@ -133,7 +133,7 @@ namespace Content.Server.Buckle.Components
break;
}
ownTransform.LocalPosition = Vector2.Zero + strap.BuckleOffset;
ownTransform.LocalPosition = strap.BuckleOffset;
}
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);
}
public void Update(PhysicsComponent physics)
{
if (!DontCollide)
return;
physics.WakeBody();
if (!IsOnStrapEntityThisFrame && DontCollide)
{
DontCollide = false;
TryUnbuckle(Owner);
Dirty();
}
IsOnStrapEntityThisFrame = false;
}
}
}

View File

@@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using Content.Shared.ActionBlocker;
using Content.Shared.Acts;
using Content.Shared.Alert;
using Content.Shared.Buckle;
using Content.Shared.Buckle.Components;
using Content.Shared.DragDrop;
using Content.Shared.Interaction;
@@ -12,7 +10,6 @@ using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -67,7 +64,7 @@ namespace Content.Server.Buckle.Components
/// Don't change it unless you really have to
/// </summary>
[DataField("maxBuckleDistance", required: false)]
public float MaxBuckleDistance = 1f;
public float MaxBuckleDistance = 0.1f;
/// <summary>
/// You can specify the offset the entity will have after unbuckling.

View File

@@ -64,14 +64,6 @@ namespace Content.Server.Buckle.Systems
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)
{
var strap = buckle.BuckledTo;

View File

@@ -29,8 +29,6 @@ namespace Content.Shared.Buckle.Components
public EntityUid? LastEntityBuckledTo { get; set; }
public bool IsOnStrapEntityThisFrame { get; set; }
public bool DontCollide { get; set; }
public abstract bool TryBuckle(EntityUid user, EntityUid to);

View File

@@ -59,7 +59,6 @@ namespace Content.Shared.Buckle
{
if (args.BodyB.Owner != component.LastEntityBuckledTo) return;
component.IsOnStrapEntityThisFrame = true;
if (component.Buckled || component.DontCollide)
{
args.Cancel();