| 1831 | } |
| 1832 | |
| 1833 | void 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 |
| 1863 | void AISubgroup::ReceiveCommand(Command& cmd) |