Remove legacy building lock calls.
This has been superseded by conditions.
This commit is contained in:
@@ -20,7 +20,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
public class CaptureActor : Enter
|
public class CaptureActor : Enter
|
||||||
{
|
{
|
||||||
readonly Actor actor;
|
readonly Actor actor;
|
||||||
readonly Building building;
|
|
||||||
readonly CaptureManager targetManager;
|
readonly CaptureManager targetManager;
|
||||||
readonly CaptureManager manager;
|
readonly CaptureManager manager;
|
||||||
|
|
||||||
@@ -28,7 +27,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
: base(self, target, EnterBehaviour.Dispose)
|
: base(self, target, EnterBehaviour.Dispose)
|
||||||
{
|
{
|
||||||
actor = target;
|
actor = target;
|
||||||
building = actor.TraitOrDefault<Building>();
|
|
||||||
manager = self.Trait<CaptureManager>();
|
manager = self.Trait<CaptureManager>();
|
||||||
targetManager = target.Trait<CaptureManager>();
|
targetManager = target.Trait<CaptureManager>();
|
||||||
}
|
}
|
||||||
@@ -72,14 +70,8 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
|
|
||||||
void DoCapture(Actor self, Captures captures)
|
void DoCapture(Actor self, Captures captures)
|
||||||
{
|
{
|
||||||
if (building != null && !building.Lock())
|
|
||||||
return;
|
|
||||||
|
|
||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (building != null && building.Locked)
|
|
||||||
building.Unlock();
|
|
||||||
|
|
||||||
// Sabotage instead of capture
|
// Sabotage instead of capture
|
||||||
if (captures.Info.SabotageThreshold > 0 && !actor.Owner.NonCombatant)
|
if (captures.Info.SabotageThreshold > 0 && !actor.Owner.NonCombatant)
|
||||||
{
|
{
|
||||||
@@ -106,9 +98,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
foreach (var t in actor.TraitsImplementing<INotifyCapture>())
|
foreach (var t in actor.TraitsImplementing<INotifyCapture>())
|
||||||
t.OnCapture(actor, self, oldOwner, self.Owner);
|
t.OnCapture(actor, self, oldOwner, self.Owner);
|
||||||
|
|
||||||
if (building != null && building.Locked)
|
|
||||||
building.Unlock();
|
|
||||||
|
|
||||||
if (self.Owner.Stances[oldOwner].HasStance(captures.Info.PlayerExperienceStances))
|
if (self.Owner.Stances[oldOwner].HasStance(captures.Info.PlayerExperienceStances))
|
||||||
{
|
{
|
||||||
var exp = self.Owner.PlayerActor.TraitOrDefault<PlayerExperience>();
|
var exp = self.Owner.PlayerActor.TraitOrDefault<PlayerExperience>();
|
||||||
|
|||||||
Reference in New Issue
Block a user