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

Method SendState

engine/Poseidon/AI/AIGroupCmd.cpp:998–1031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996}
997
998void AIGroup::SendState(RadioMessageState* msg, bool silent)
999{
1000 // usually called with new
1001 // if message is not queued we have the only reference to the message
1002 Ref<RadioMessageState> ref = msg;
1003 AIUnit* leader = Leader();
1004 for (int i = 0; i < MAX_UNITS_PER_GROUP; i++)
1005 {
1006 AIUnit* unit = UnitWithID(i + 1);
1007 if (!unit)
1008 {
1009 continue;
1010 }
1011 if (!msg->IsTo(unit))
1012 {
1013 continue;
1014 }
1015
1016 if (!leader || unit == leader || silent)
1017 {
1018 // leader command is executed directly
1019 Ref<RadioMessageState> temp = msg->Clone();
1020 temp->ClearTo();
1021 temp->AddTo(unit);
1022 temp->Transmitted();
1023 msg->DeleteTo(unit);
1024 continue;
1025 }
1026 }
1027 if (leader && msg->IsToSomeone())
1028 {
1029 GetRadio().Transmit(msg, GetCenter()->GetLanguage());
1030 }
1031}
1032
1033void AIGroup::SendReportStatus(PackedBoolArray list)
1034{

Callers 11

IssueWatchMethod · 0.80
IssueCommandMethod · 0.80
IssueWatchAroundMethod · 0.80
IssueEngageMethod · 0.80
IssueFireMethod · 0.80
IssueWatchAutoMethod · 0.80
IssueWatchMethod · 0.80
SetUnitPositionMethod · 0.80
SetFormationPosMethod · 0.80
VehFireFunction · 0.80
VehWatchFunction · 0.80

Calls 9

GetCenterFunction · 0.85
ClearToMethod · 0.80
AddToMethod · 0.80
DeleteToMethod · 0.80
IsToSomeoneMethod · 0.80
IsToMethod · 0.45
CloneMethod · 0.45
TransmittedMethod · 0.45
GetLanguageMethod · 0.45

Tested by

no test coverage detected