Prevent an infinite loop when planes go out of ammo and all airfields are gone

This commit is contained in:
Oliver Brakmann
2016-09-05 19:59:01 +02:00
parent 351c231693
commit daa1f16e98

View File

@@ -112,8 +112,12 @@ namespace OpenRA.Mods.Common.Activities
new FlyCircleTimed(self, plane.Info.NumberOfTicksToVerifyAvailableAirport), new FlyCircleTimed(self, plane.Info.NumberOfTicksToVerifyAvailableAirport),
this); this);
else 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; return NextActivity;
} }
}
List<Activity> landingProcedures = new List<Activity>(); List<Activity> landingProcedures = new List<Activity>();