diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 67df77dbb7..b312571a8b 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -1,4 +1,4 @@ - + Debug @@ -98,6 +98,7 @@ + diff --git a/OpenRA.Mods.RA/ReservableProduction.cs b/OpenRA.Mods.RA/ReservableProduction.cs new file mode 100644 index 0000000000..00f0a2f2ca --- /dev/null +++ b/OpenRA.Mods.RA/ReservableProduction.cs @@ -0,0 +1,33 @@ +#region Copyright & License Information +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ +#endregion + + +using OpenRA.Traits; + +namespace OpenRA.Mods.RA +{ + // a small hack to teach Production about Reservable. + + public class ReservableProductionInfo : ProductionInfo, ITraitPrerequisite + { + public override object Create(ActorInitializer init) { return new ReservableProduction(); } + } + + class ReservableProduction : Production + { + public override bool Produce(Actor self, OpenRA.GameRules.ActorInfo producee) + { + if (Reservable.IsReserved(self)) + return false; + + return base.Produce(self, producee); + } + } +} diff --git a/mods/ra/structures.yaml b/mods/ra/structures.yaml index a723aecfa7..362681668a 100644 --- a/mods/ra/structures.yaml +++ b/mods/ra/structures.yaml @@ -556,7 +556,7 @@ HPAD: RevealsShroud: Range: 5 Bib: - Production: + ReservableProduction: SpawnOffset: 0,-4 Produces: Plane BelowUnits: @@ -583,7 +583,7 @@ AFLD: Armor: heavy RevealsShroud: Range: 7 - Production: + ReservableProduction: Produces: Plane BelowUnits: Reservable: