Skip to content

Commit

Permalink
Destroyed ships shouldn't be allowed to execute orders (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekolis committed May 1, 2022
1 parent 75e4887 commit c0f064d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FrEee/Utility/Extensions/CommonExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public static bool ExecuteMobileSpaceObjectOrders<T>(this T o)
if (o is Fleet f && !f.Vehicles.ExceptSingle(null).Any())
o.Dispose();
var runOrders = new List<IOrder>();
while (!o.IsDisposed && o.Orders.Any() && (o.TimeToNextMove <= 1e-15 || !o.Orders.First().ConsumesMovement))
while (!o.IsDisposed && !o.IsDestroyed && o.Orders.Any() && (o.TimeToNextMove <= 1e-15 || !o.Orders.First().ConsumesMovement))
{
var order = o.Orders.First();
order.Execute(o);
Expand Down

0 comments on commit c0f064d

Please sign in to comment.