From aebb97967d86947b8351685e2aac09072c876ae8 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 11 Feb 2025 18:58:14 +0000 Subject: [PATCH] Fix a bad comparison against Target.Invalid. Target.Invalid acts like a NaN, and will not compare equal with itself. Compare against the TargetType instead, which performs the intended comparison. --- OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs index 94dadd378d..447d9cd872 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs @@ -195,7 +195,7 @@ namespace OpenRA.Mods.Common.Traits // Tell the idle harvester to quit slacking: var newSafeResourcePatch = FindNextResource(h.Actor, h); AIUtils.BotDebug($"AI: Harvester {h.Actor} is idle. Ordering to {newSafeResourcePatch} in search for new resources."); - if (newSafeResourcePatch != Target.Invalid) + if (newSafeResourcePatch.Type != TargetType.Invalid) bot.QueueOrder(new Order("Harvest", h.Actor, newSafeResourcePatch, false)); else h.NoResourcesCooldown = Info.ScanIntervalMultiplerWhenNoResources;