MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetInGetIn

Function GetInGetIn

engine/Poseidon/AI/AISubgroupFSM.cpp:2066–2089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2064}
2065
2066static void GetInGetIn(AISubgroupContext* context)
2067{
2068 STATE_PREFIX
2069 if (!subgrp->HasAI())
2070 {
2071 return;
2072 }
2073
2074 LogFSM(subgrp, "GetIn", "GETIN");
2075
2076 AIUnit* leader = subgrp->Leader();
2077 AI_ERROR(leader->IsFreeSoldier());
2078 Transport* vehInto = dyn_cast<Transport, Object>(cmd->_target);
2079 if (!vehInto)
2080 {
2081 context->_fsm->SetState(SGetInFail, context);
2082 return;
2083 }
2084 if (!leader->ProcessGetIn(*vehInto))
2085 {
2086 context->_fsm->SetState(SGetInFail, context);
2087 }
2088 // else subgroup dies out
2089}
2090
2091static void CheckGetInGetIn(AISubgroupContext* context)
2092{

Callers

nothing calls this directly

Calls 6

LogFSMFunction · 0.85
IsFreeSoldierMethod · 0.80
HasAIMethod · 0.45
LeaderMethod · 0.45
SetStateMethod · 0.45
ProcessGetInMethod · 0.45

Tested by

no test coverage detected