From daa1f16e987a26120436aa31a38f06223dc5fc9b Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Mon, 5 Sep 2016 19:59:01 +0200 Subject: [PATCH] Prevent an infinite loop when planes go out of ammo and all airfields are gone --- OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs b/OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs index 6056113c0b..9ca9e7aaeb 100644 --- a/OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs +++ b/OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs @@ -112,7 +112,11 @@ namespace OpenRA.Mods.Common.Activities new FlyCircleTimed(self, plane.Info.NumberOfTicksToVerifyAvailableAirport), this); else + { + // Prevent an infinite loop in case we'd return to the activity that called ReturnToBase in the first place. Go idle instead. + Cancel(self); return NextActivity; + } } List landingProcedures = new List();