Cancel support power targeting if power cannot be activated.
This commit is contained in:
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
protected override void Tick(World world)
|
protected override void Tick(World world)
|
||||||
{
|
{
|
||||||
// Cancel the OG if we can't use the power
|
// 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();
|
world.CancelInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
protected override void Tick(World world)
|
protected override void Tick(World world)
|
||||||
{
|
{
|
||||||
// Cancel the OG if we can't use the power
|
// 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();
|
world.CancelInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
protected override void Tick(World world)
|
protected override void Tick(World world)
|
||||||
{
|
{
|
||||||
// Cancel the OG if we can't use the power
|
// 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();
|
world.CancelInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected override void Tick(World world)
|
protected override void Tick(World world)
|
||||||
{
|
{
|
||||||
// Cancel the OG if we can't use the power
|
// 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();
|
world.CancelInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
void IOrderGenerator.Tick(World world)
|
void IOrderGenerator.Tick(World world)
|
||||||
{
|
{
|
||||||
// Cancel the OG if we can't use the power
|
// 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();
|
world.CancelInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected override void Tick(World world)
|
protected override void Tick(World world)
|
||||||
{
|
{
|
||||||
// Cancel the OG if we can't use the power
|
// 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();
|
world.CancelInputMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user