| 2180 | } |
| 2181 | |
| 2182 | static void GetOutMove(AISubgroupContext* context) |
| 2183 | { |
| 2184 | STATE_PREFIX |
| 2185 | |
| 2186 | AIUnit* leader = subgrp->Leader(); |
| 2187 | |
| 2188 | LogFSM(subgrp, "GetOut", "Move"); |
| 2189 | |
| 2190 | if (!cmd->_target) |
| 2191 | { |
| 2192 | context->_fsm->SetState(SGetOutDone, context); |
| 2193 | return; |
| 2194 | } |
| 2195 | |
| 2196 | Vector3Val posL = subgrp->Leader()->Position(); |
| 2197 | Vector3Val posV = cmd->_target->Position(); |
| 2198 | float distance = (cmd->_target->GetRadius() * 0.9f + 1.0f); |
| 2199 | |
| 2200 | Vector3 norm = (posL - posV); |
| 2201 | Point3 posD = posV + norm.Normalized() * distance; |
| 2202 | Vector3 normal; |
| 2203 | leader->FindNearestEmpty(posD); |
| 2204 | |
| 2205 | subgrp->GoDirect(posD); |
| 2206 | } |
| 2207 | |
| 2208 | static void CheckGetOutMove(AISubgroupContext* context) |
| 2209 | { |
nothing calls this directly
no test coverage detected