MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / updateAI

Method updateAI

game/state/battle/battleunit.cpp:3725–3739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3723}
3724
3725void BattleUnit::updateAI(GameState &state, unsigned int)
3726{
3727 if (!isConscious())
3728 {
3729 return;
3730 }
3731
3732 // Decide
3733 auto decision = aiList.think(state, *this);
3734 if (!decision.isEmpty())
3735 {
3736 LogWarning("AI %s for unit %s decided to %s", decision.ai, id, decision.getName());
3737 executeAIDecision(state, decision);
3738 }
3739}
3740
3741void BattleUnit::triggerProximity(GameState &state)
3742{

Callers

nothing calls this directly

Calls 3

thinkMethod · 0.45
isEmptyMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected