Small bugfix in Petra's Defense manager
We were incorrectly comparing an object to a number. I don't think this will drastically change the AI behaviour as it's rather an edge case. Reviewed By: Freagarach Differential Revision: https://code.wildfiregames.com/D5030 This was SVN commit r27732.
This commit is contained in:
parent
7df7566d7c
commit
3190729f85
@ -684,12 +684,12 @@ PETRA.DefenseManager.prototype.checkEvents = function(gameState, events)
|
||||
{
|
||||
let unitAIState = target.unitAIState();
|
||||
let unitAIStateOrder = unitAIState ? unitAIState.split(".")[1] : "";
|
||||
if (unitAIStateOrder == "COMBAT" && (currentTarget == attacker.id() ||
|
||||
if (unitAIStateOrder === "COMBAT" && (currentTarget.id() === attacker.id() ||
|
||||
!currentTarget.hasClasses(["Structure", "Support"])))
|
||||
continue;
|
||||
if (unitAIStateOrder == "REPAIR" && currentTarget.hasDefensiveFire())
|
||||
if (unitAIStateOrder === "REPAIR" && currentTarget.hasDefensiveFire())
|
||||
continue;
|
||||
if (unitAIStateOrder == "COMBAT" && !PETRA.isSiegeUnit(currentTarget) &&
|
||||
if (unitAIStateOrder === "COMBAT" && !PETRA.isSiegeUnit(currentTarget) &&
|
||||
gameState.ai.HQ.capturableTargets.has(orderData[0].target))
|
||||
{
|
||||
// Take the nearest unit also attacking this structure to help us.
|
||||
|
Loading…
Reference in New Issue
Block a user