* @brief Initializes the pathfinding node array for a creature. * * Allocates a BoxNode for each pathfinding box in the level. These nodes store * the search state during pathfinding (exit box, search number, expansion chain). * Only initializes once per creature (checked via LOT.Initialized flag). * * @param itemNumber Index of the creature item in g_Level.Items. */
| 53 | * @param itemNumber Index of the creature item in g_Level.Items. |
| 54 | */ |
| 55 | void InitializeLOTarray(int itemNumber) |
| 56 | { |
| 57 | auto* item = &g_Level.Items[itemNumber]; |
| 58 | auto* creature = GetCreatureInfo(item); |
| 59 | |
| 60 | if (!creature->LOT.Initialized) |
| 61 | { |
| 62 | creature->LOT.Node = std::vector<BoxNode>(g_Level.PathfindingBoxes.size(), BoxNode{}); |
| 63 | creature->LOT.BadBoxes = std::vector<BadBox>(BAD_BOX_MEMORY_SIZE, BadBox{}); |
| 64 | creature->LOT.Initialized = true; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @brief Enables AI processing for a creature. |
no test coverage detected