Remove obsolete building lock check from BaseProvider.

This commit is contained in:
Paul Chote
2018-10-06 15:06:29 +01:00
committed by abcdefg30
parent 22bd7fd90b
commit de8fa56461

View File

@@ -27,15 +27,13 @@ namespace OpenRA.Mods.Common.Traits
public override object Create(ActorInitializer init) { return new BaseProvider(init.Self, this); } public override object Create(ActorInitializer init) { return new BaseProvider(init.Self, this); }
} }
public class BaseProvider : PausableConditionalTrait<BaseProviderInfo>, ITick, INotifyCreated, IRenderAboveShroudWhenSelected, ISelectionBar public class BaseProvider : PausableConditionalTrait<BaseProviderInfo>, ITick, IRenderAboveShroudWhenSelected, ISelectionBar
{ {
readonly DeveloperMode devMode; readonly DeveloperMode devMode;
readonly Actor self; readonly Actor self;
readonly bool allyBuildEnabled; readonly bool allyBuildEnabled;
readonly bool buildRadiusEnabled; readonly bool buildRadiusEnabled;
Building building;
int total; int total;
int progress; int progress;
@@ -50,11 +48,6 @@ namespace OpenRA.Mods.Common.Traits
buildRadiusEnabled = mapBuildRadius != null && mapBuildRadius.BuildRadiusEnabled; buildRadiusEnabled = mapBuildRadius != null && mapBuildRadius.BuildRadiusEnabled;
} }
void INotifyCreated.Created(Actor self)
{
building = self.TraitOrDefault<Building>();
}
void ITick.Tick(Actor self) void ITick.Tick(Actor self)
{ {
if (progress > 0) if (progress > 0)
@@ -68,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
public bool Ready() public bool Ready()
{ {
if (IsTraitDisabled || IsTraitPaused || (building != null && building.Locked)) if (IsTraitDisabled || IsTraitPaused)
return false; return false;
return devMode.FastBuild || progress == 0; return devMode.FastBuild || progress == 0;