Fix nested preconditions not evaluating costs (#618)

Fixed an issue with some builds that had preconditions not taking items from the players due to the evaluate costs parameter not being passed to nested conditions.

Tested the build in Avant Gardens and it now correctly takes items from the player upon completion.
This commit is contained in:
David Markowitz 2022-07-06 19:29:15 -07:00 committed by GitHub
parent 0734760d42
commit 22b2516107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,7 +317,7 @@ bool PreconditionExpression::Check(Entity* player, bool evaluateCosts) const
GameMessages::SendNotifyClientFailedPrecondition(player->GetObjectID(), player->GetSystemAddress(), u"", condition); GameMessages::SendNotifyClientFailedPrecondition(player->GetObjectID(), player->GetSystemAddress(), u"", condition);
} }
const auto b = next == nullptr ? true : next->Check(player); const auto b = next == nullptr ? true : next->Check(player, evaluateCosts);
return m_or ? a || b : a && b; return m_or ? a || b : a && b;
} }