Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix location checks for queued deployment. #16748

Merged
merged 1 commit into from Jul 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 1 addition & 9 deletions OpenRA.Mods.Common/Activities/Transform.cs
Expand Up @@ -51,10 +51,7 @@ public override bool Tick(Actor self)
// Prevent deployment in bogus locations
var transforms = self.TraitOrDefault<Transforms>();
if (transforms != null && !transforms.CanDeploy())
{
Cancel(self, true);
return true;
}

foreach (var nt in self.TraitsImplementing<INotifyTransform>())
nt.BeforeTransform(self);
Expand All @@ -71,15 +68,10 @@ public override bool Tick(Actor self)
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be return true now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True 😛

But it doesn't matter either way. The childactivity will never finish so this will never actually proceed to the next activity.

}

DoTransform(self);
return true;
}

protected override void OnLastRun(Actor self)
{
if (!IsCanceling)
DoTransform(self);
}

void DoTransform(Actor self)
{
// This activity may be buried as a child within one or more parents
Expand Down
5 changes: 1 addition & 4 deletions OpenRA.Mods.Common/Traits/Transforms.cs
Expand Up @@ -137,10 +137,7 @@ public void DeployTransform(bool queued)
return;
}

if (!queued)
self.CancelActivity();

self.QueueActivity(GetTransformActivity(self));
self.QueueActivity(queued, GetTransformActivity(self));
}

public void ResolveOrder(Actor self, Order order)
Expand Down