Some vehicle bugfixes (#11692)
This commit is contained in:
@@ -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