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

Function EnableEntityAI

TombEngine/Game/control/lot.cpp:80–92  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

78 * @return true if creature AI is now active.
79 */
80bool 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.

Callers 6

SkidooManControlFunction · 0.85
BaddyControlFunction · 0.85
RespawnAhmetFunction · 0.85
ParseLevelFunction · 0.85
CreatureActiveFunction · 0.85
TriggerFunction · 0.85

Calls 3

InitializeSlotFunction · 0.85
IsCreatureMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected