* @brief Checks if a pathfinding box is bad and currently in cooldown. * * @param lot Pointer to the creature's LOT (pathfinding state). * @param boxNumber Pathfinding box to check. * @return true if the box is in cooldown, false otherwise. */
| 596 | * @return true if the box is in cooldown, false otherwise. |
| 597 | */ |
| 598 | static bool IsBoxInCooldown(const LOTInfo* LOT, int boxNumber) |
| 599 | { |
| 600 | if (boxNumber == NO_VALUE) |
| 601 | return false; |
| 602 | |
| 603 | for (const auto& badBox : LOT->BadBoxes) |
| 604 | { |
| 605 | if (badBox.BoxNumber == boxNumber && badBox.Count < 0) |
| 606 | return true; |
| 607 | } |
| 608 | |
| 609 | return false; |
| 610 | } |
| 611 | |
| 612 | /** |
| 613 | * @brief Updates the creature's bad box memory. |