Some vehicle bugfixes (#11692)
This commit is contained in:
@@ -6,7 +6,6 @@ using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -22,6 +21,7 @@ public abstract class SharedJetpackSystem : EntitySystem
|
||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||
[Dependency] protected readonly SharedContainerSystem Container = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popups = default!;
|
||||
[Dependency] private readonly SharedMoverController _mover = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public abstract class SharedJetpackSystem : EntitySystem
|
||||
{
|
||||
var user = EnsureComp<JetpackUserComponent>(uid);
|
||||
var relay = EnsureComp<RelayInputMoverComponent>(uid);
|
||||
relay.RelayEntity = component.Owner;
|
||||
_mover.SetRelay(uid, component.Owner, relay);
|
||||
user.Jetpack = component.Owner;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,19 @@ public abstract partial class SharedMoverController
|
||||
SubscribeLocalEvent<RelayInputMoverComponent, ComponentShutdown>(OnRelayShutdown);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the relay entity and marks the component as dirty. This only exists because people have previously
|
||||
/// forgotten to Dirty(), so fuck you, you have to use this method now.
|
||||
/// </summary>
|
||||
public void SetRelay(EntityUid uid, EntityUid relayEntity, RelayInputMoverComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return;
|
||||
|
||||
component.RelayEntity = relayEntity;
|
||||
Dirty(component);
|
||||
}
|
||||
|
||||
private void OnRelayShutdown(EntityUid uid, RelayInputMoverComponent component, ComponentShutdown args)
|
||||
{
|
||||
// If relay is removed then cancel all inputs.
|
||||
|
||||
Reference in New Issue
Block a user