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

Method setMission

game/state/shared/agent.cpp:856–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856bool Agent::setMission(GameState &state, AgentMission mission)
857{
858 for (auto &m : this->missions)
859 {
860 // if we're removing an InvestigateBuilding mission
861 // decrease the investigate count so the other investigating vehicles won't dangle
862 if (m.type == AgentMission::MissionType::InvestigateBuilding)
863 {
864 if (!m.isFinished(state, *this))
865 {
866 m.targetBuilding->decreasePendingInvestigatorCount(state);
867 }
868 }
869 }
870 missions.clear();
871 missions.emplace_front(mission);
872 missions.front().start(state, *this);
873 return true;
874}
875
876bool Agent::popFinishedMissions(GameState &state)
877{

Callers 3

purchaseMethod · 0.45
updateMissionsMethod · 0.45
executeMethod · 0.45

Calls 4

isFinishedMethod · 0.45
clearMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected