* @brief Enables AI processing for a creature. * * If the creature doesn't already have AI enabled, initializes its CreatureInfo * slot and adds it to the ActiveCreatures list. This must be called before a * creature can pathfind or exhibit intelligent behavior. * * @param itemNum Index of the creature item. * @param always Unused parameter (legacy from TR slot system). * @param makeTarget
| 78 | * @return true if creature AI is now active. |
| 79 | */ |
| 80 | bool EnableEntityAI(short itemNum, bool always, bool makeTarget) |
| 81 | { |
| 82 | ItemInfo* item = &g_Level.Items[itemNum]; |
| 83 | |
| 84 | // Already has AI enabled. |
| 85 | if (item->IsCreature()) |
| 86 | return true; |
| 87 | |
| 88 | InitializeSlot(itemNum, makeTarget); |
| 89 | ActiveCreatures.push_back(item->Index); |
| 90 | |
| 91 | return item->IsCreature(); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * @brief Disables AI processing for a creature. |
no test coverage detected