MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / setAIState

Method setAIState

src/Savegame/BattleUnit.cpp:1582–1591  ·  view source on GitHub ↗

* Changes the current AI state. * @param aiState Pointer to AI state. */

Source from the content-addressed store, hash-verified

1580 * @param aiState Pointer to AI state.
1581 */
1582void BattleUnit::setAIState(BattleAIState *aiState)
1583{
1584 if (_currentAIState)
1585 {
1586 _currentAIState->exit();
1587 delete _currentAIState;
1588 }
1589 _currentAIState = aiState;
1590 _currentAIState->enter();
1591}
1592
1593/**
1594 * Returns the current AI state.

Callers 6

loadMethod · 0.80
addAlienMethod · 0.80
addCivilianMethod · 0.80
handleAIMethod · 0.80
convertUnitMethod · 0.80
tryReactionSnapMethod · 0.80

Calls 2

exitMethod · 0.45
enterMethod · 0.45

Tested by

no test coverage detected