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

Method IssueGetIn

engine/Poseidon/UI/InGame/InGameUI.cpp:2361–2528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
2388void 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
2404void 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();

Callers

nothing calls this directly

Calls 15

IsEmptySelectedUnitsFunction · 0.85
GetSelectedUnitFunction · 0.85
ClearSelectedUnitsFunction · 0.85
SetSelectedUnitFunction · 0.85
ListSelectedUnitsFunction · 0.85
GetDriverAssignedMethod · 0.80
QIsDriverInMethod · 0.80
CommandSentMethod · 0.80
GetCommanderAssignedMethod · 0.80
QIsCommanderInMethod · 0.80
GetGunnerAssignedMethod · 0.80
QIsGunnerInMethod · 0.80

Tested by

no test coverage detected