| 1275 | // Destroy waypoint |
| 1276 | |
| 1277 | static TargetType* GetDestroyTarget(AIGroupContext* context) |
| 1278 | { |
| 1279 | STATE_PREFIX |
| 1280 | |
| 1281 | int& id = context->_fsm->Var(3); |
| 1282 | int& idStatic = context->_fsm->Var(2); |
| 1283 | EntityAI* target = nullptr; |
| 1284 | |
| 1285 | if (id >= 0 && id < vehiclesMap.Size()) |
| 1286 | { |
| 1287 | target = vehiclesMap[id]; |
| 1288 | } |
| 1289 | else if (idStatic >= 0) |
| 1290 | { |
| 1291 | target = dyn_cast<TargetType>(GLOB_LAND->FindObject(idStatic)); |
| 1292 | } |
| 1293 | else |
| 1294 | { |
| 1295 | target = dyn_cast<TargetType>(GLOB_LAND->NearestObject(mission->_destination, 100.0f, TypeVehicle)); |
| 1296 | } |
| 1297 | return target; |
| 1298 | } |
| 1299 | |
| 1300 | static bool CheckArcadeDestroyMoveHelper(AIGroupContext* context) |
| 1301 | { |
no test coverage detected