Cancel support power targeting if power cannot be activated.

This commit is contained in:
Paul Chote
2021-01-10 12:17:25 +00:00
committed by reaperrr
parent 02a2624bcc
commit e990a83b7a
5 changed files with 6 additions and 6 deletions

View File

@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -174,7 +174,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}
@@ -274,7 +274,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Traits
void IOrderGenerator.Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -309,7 +309,7 @@ namespace OpenRA.Mods.Common.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}