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

Method getNewGoal

game/state/shared/agent.cpp:914–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912}
913
914bool Agent::getNewGoal(GameState &state)
915{
916 bool popped = false;
917 bool acquired = false;
918 // Pop finished missions if present
919 popped = popFinishedMissions(state);
920 do
921 {
922 // Try to get new destination
923 if (!missions.empty())
924 {
925 acquired = missions.front().getNextDestination(state, *this, goalPosition);
926 }
927 // Pop finished missions if present
928 popped = popFinishedMissions(state);
929 } while (popped && !acquired);
930 return acquired;
931}
932
933void Agent::die(GameState &state, bool silent)
934{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
getNextDestinationMethod · 0.45

Tested by

no test coverage detected