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

Method ClearGetInCommands

engine/Poseidon/AI/AISubgroup.cpp:1833–1860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1831}
1832
1833void AISubgroup::ClearGetInCommands()
1834{
1835 int i;
1836 bool deletedLast = false;
1837 for (i = 0; i < _stack.Size();)
1838 {
1839 Command* cmd = _stack[i]._task;
1840 if ((cmd->_context == Command::CtxAuto || cmd->_context == Command::CtxAutoSilent) &&
1841 (cmd->_message == Command::GetIn))
1842 {
1843 if (i == _stack.Size() - 1)
1844 {
1845 deletedLast = true;
1846 }
1847 AISubgroupContext context(this);
1848 base::Delete(i, &context, false); // do not refresh
1849 }
1850 else
1851 {
1852 i++;
1853 }
1854 }
1855
1856 if (deletedLast)
1857 {
1858 Stop();
1859 }
1860}
1861
1862// Communication with group
1863void AISubgroup::ReceiveCommand(Command& cmd)

Callers 1

AllowGetInMethod · 0.45

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected