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

Function WhatUnits

engine/Poseidon/Game/Chat.cpp:518–559  ·  view source on GitHub ↗

Players that can receive a message on the given channel from object.

Source from the content-addressed store, hash-verified

516 {
517 if (_speaking[src].lastSpeaking >= Glob.uiTime - 1.0f)
518 {
519 if (dst != src)
520 {
521 _speaking[dst] = _speaking[src];
522 }
523 dst++;
524 }
525 }
526 _speaking.Resize(dst);
527}
528
529static void WhatUnitsVehicle(RefArray<NetworkObject>& units, Transport* veh)
530{
531 Person* person = veh->Driver();
532 if (person && person->IsRemotePlayer())
533 {
534 units.Add(person);
535 }
536 person = veh->Commander();
537 if (person && person->IsRemotePlayer())
538 {
539 units.Add(person);
540 }
541 person = veh->Gunner();
542 if (person && person->IsRemotePlayer())
543 {
544 units.Add(person);
545 }
546}
547
548static void WhatUnitsGroup(RefArray<NetworkObject>& units, AIGroup* grp)
549{
550 for (int i = 0; i < MAX_UNITS_PER_GROUP; i++)
551 {
552 AIUnit* unit = grp->UnitWithID(i + 1);
553 if (!unit)
554 {
555 continue;
556 }
557 Person* person = unit->GetPerson();
558 if (person && person->IsRemotePlayer())
559 {
560 units.Add(person);
561 }
562 }

Callers 6

KilledByMethod · 0.85
SendChatFunction · 0.85
SendRadioChatWaveFunction · 0.85
SendRadioChatFunction · 0.85
SendMarkerFunction · 0.85
ResetHUDMethod · 0.85

Calls 11

WhatUnitsVehicleFunction · 0.85
WhatUnitsGroupFunction · 0.85
WhatUnitsSideFunction · 0.85
WhatUnitsDirectFunction · 0.85
GetVehicleInMethod · 0.80
IsFreeSoldierMethod · 0.80
GetPersonMethod · 0.80
GetRealPlayerMethod · 0.80
BrainMethod · 0.80
GetGroupMethod · 0.45
GetCenterMethod · 0.45

Tested by

no test coverage detected