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

Function SetCommandState

engine/Poseidon/UI/Map/UIMapMain.cpp:75–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73namespace Poseidon
74{
75void SetCommandState(int id, CommandState state, AISubgroup* subgrp)
76{
77 AIGroup* grp = subgrp->GetGroup();
78 for (int i = 0; i < GMainMapInfo.commands.Size();)
79 {
80 CommandInfo& cmd = GMainMapInfo.commands[i];
81 if (cmd.grp == grp && cmd.id == id)
82 {
83 cmd.state = state;
84 cmd.subgrp = subgrp;
85 i++;
86 }
87 else if (cmd.subgrp == subgrp)
88 {
89 GMainMapInfo.commands.Delete(i);
90 }
91 else
92 {
93 i++;
94 }
95 }
96}
97} // namespace Poseidon
98
99void AddUnitInfo(AIUnit* unit)

Callers 3

ReceiveCommandMethod · 0.85
CommandSucceedFunction · 0.85
CommandFailedFunction · 0.85

Calls 3

GetGroupMethod · 0.45
SizeMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected