MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / InitializeLOTarray

Function InitializeLOTarray

TombEngine/Game/control/lot.cpp:55–66  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

53 * @param itemNumber Index of the creature item in g_Level.Items.
54 */
55void 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.

Callers 1

InitializeSlotFunction · 0.85

Calls 2

GetCreatureInfoFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected