| 2359 | { |
| 2360 | return; |
| 2361 | } |
| 2362 | const TargetList& list = grp->GetTargetList(); |
| 2363 | Target* tgt = nullptr; |
| 2364 | for (int i = 0; i < list.Size(); i++) |
| 2365 | { |
| 2366 | Target* tar = list[i]; |
| 2367 | EntityAI* killer = tar->idKiller; |
| 2368 | if (!killer) |
| 2369 | { |
| 2370 | continue; |
| 2371 | } |
| 2372 | if ((killer == unit->GetVehicle() || killer == unit->GetPerson()) && tar->destroyed && |
| 2373 | (tar->timeReported <= TIME_MIN || tar->timeReported < Glob.time - 30)) |
| 2374 | { |
| 2375 | tgt = tar; |
| 2376 | // mark as reported |
| 2377 | tar->timeReported = Glob.time; |
| 2378 | tar->posReported = tar->position; |
| 2379 | break; |
| 2380 | } |
| 2381 | } |
| 2382 | |
| 2383 | AICenter* center = grp->GetCenter(); |
| 2384 | grp->GetRadio().Transmit(new RadioMessageObjectDestroyed(unit, grp, tgt ? tgt->type : nullptr), |
| 2385 | center->GetLanguage()); |
| 2386 | } |
| 2387 | |
| 2388 | void InGameUI::SendKilled(AIUnit* unit, PackedBoolArray list) |
| 2389 | { |
| 2390 | AIGroup* grp = unit->GetGroup(); |
| 2391 | if (!grp) |
| 2392 | { |
| 2393 | return; |
| 2394 | } |
| 2395 | for (int i = 0; i < MAX_UNITS_PER_GROUP; i++) |
| 2396 | { |
| 2397 | if (list.Get(i)) |
| 2398 | { |
| 2399 | grp->SendUnitDown(unit, grp->UnitWithID(i + 1)); |
| 2400 | } |
| 2401 | } |
| 2402 | } |
| 2403 | |
| 2404 | void InGameUI::IssueWatch(AIGroup* grp, int what) |
| 2405 | { |
| 2406 | if (IsEmptySelectedUnits()) |
| 2407 | { |
| 2408 | return; |
| 2409 | } |
| 2410 | |
| 2411 | int dir = what; |
| 2412 | float angle = (-2 * H_PI / N_WATCH_DIR) * dir; |
| 2413 | Matrix3 rotY(MRotationY, angle); |
| 2414 | Vector3 tgtDir = rotY.Direction(); |
| 2415 | |
| 2416 | grp->SendState(new RadioMessageWatchDir(grp, ListSelectedUnits(), tgtDir)); |
| 2417 | |
| 2418 | ClearSelectedUnits(); |
nothing calls this directly
no test coverage detected