Allow early salvage launches (#16503)
This commit is contained in:
9
Content.Server/Shuttles/Events/ConsoleFTLAttemptEvent.cs
Normal file
9
Content.Server/Shuttles/Events/ConsoleFTLAttemptEvent.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Content.Server.Shuttles.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a shuttle console is trying to FTL via UI input.
|
||||
/// </summary>
|
||||
/// <param name="Cancelled"></param>
|
||||
/// <param name="Reason"></param>
|
||||
[ByRefEvent]
|
||||
public record struct ConsoleFTLAttemptEvent(EntityUid Uid, bool Cancelled, string Reason);
|
||||
@@ -96,6 +96,18 @@ public sealed partial class ShuttleSystem
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uid != null)
|
||||
{
|
||||
var ev = new ConsoleFTLAttemptEvent(uid.Value, false, string.Empty);
|
||||
RaiseLocalEvent(uid.Value, ref ev, true);
|
||||
|
||||
if (ev.Cancelled)
|
||||
{
|
||||
reason = ev.Reason;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
reason = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user