Remove building lock from Production.

This commit is contained in:
Paul Chote
2018-10-28 12:55:57 +00:00
committed by abcdefg30
parent 7bc53dd266
commit e57087cb5b
2 changed files with 8 additions and 10 deletions

View File

@@ -34,8 +34,6 @@ namespace OpenRA.Mods.Common.Traits
public string Faction { get; private set; } public string Faction { get; private set; }
Building building;
public Production(ActorInitializer init, ProductionInfo info) public Production(ActorInitializer init, ProductionInfo info)
: base(info) : base(info)
{ {
@@ -43,11 +41,6 @@ namespace OpenRA.Mods.Common.Traits
Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
} }
void INotifyCreated.Created(Actor self)
{
building = self.TraitOrDefault<Building>();
}
public virtual void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string productionType, TypeDictionary inits) public virtual void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string productionType, TypeDictionary inits)
{ {
var exit = CPos.Zero; var exit = CPos.Zero;
@@ -131,7 +124,7 @@ namespace OpenRA.Mods.Common.Traits
public virtual bool Produce(Actor self, ActorInfo producee, string productionType, TypeDictionary inits) public virtual bool Produce(Actor self, ActorInfo producee, string productionType, TypeDictionary inits)
{ {
if (IsTraitDisabled || IsTraitPaused || Reservable.IsReserved(self) || (building != null && building.Locked)) if (IsTraitDisabled || IsTraitPaused || Reservable.IsReserved(self))
return false; return false;
// Pick a spawn/exit point pair // Pick a spawn/exit point pair

View File

@@ -22,7 +22,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
get get
{ {
return "Traits are no longer force-disabled while the WithMakeAnimation trait is active.\n" + return "Traits are no longer force-disabled while the WithMakeAnimation trait is active.\n" +
"This affects the With*Animation, With*Overlay, Transforms, Sellable, Gate, ToggleConditionOnOrder, and ConyardChronoReturn traits.\n" + "This affects the With*Animation, With*Overlay, *Production, Transforms, Sellable,\n" +
"Gate, ToggleConditionOnOrder, and ConyardChronoReturn traits.\n" +
"The AnnounceOnBuild trait has been replaced with a new VoiceAnnouncement trait.\n" + "The AnnounceOnBuild trait has been replaced with a new VoiceAnnouncement trait.\n" +
"Affected actors are listed so that conditions may be manually defined."; "Affected actors are listed so that conditions may be manually defined.";
} }
@@ -52,6 +53,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"WithDeliveryAnimation", "WithDeliveryAnimation",
"WithCrumbleOverlay", "WithCrumbleOverlay",
"WithDeliveryOverlay", "WithDeliveryOverlay",
"Production",
"ProductionAirdrop",
"ProductionFromMapEdge",
"ProductionParadrop",
"Transforms", "Transforms",
"Sellable", "Sellable",
"Gate", "Gate",