| 1226 | } |
| 1227 | |
| 1228 | void AIGroup::SendAutoCommandToUnit(Command& cmd, AIUnit* unit, bool join, bool channelCenter) |
| 1229 | { |
| 1230 | AI_ERROR(unit); |
| 1231 | if (!unit || !unit->IsUnit()) |
| 1232 | { |
| 1233 | return; |
| 1234 | } |
| 1235 | AISubgroup* subgrp = unit->GetSubgroup(); |
| 1236 | AI_ERROR(subgrp); |
| 1237 | if (!subgrp) |
| 1238 | { |
| 1239 | return; |
| 1240 | } |
| 1241 | |
| 1242 | PackedBoolArray list; |
| 1243 | list.Set(unit->ID() - 1, true); |
| 1244 | |
| 1245 | if (join) |
| 1246 | { |
| 1247 | cmd._joinToSubgroup = subgrp; |
| 1248 | cmd._context = Command::CtxAuto; |
| 1249 | } |
| 1250 | else |
| 1251 | { |
| 1252 | cmd._context = Command::CtxAuto; |
| 1253 | } |
| 1254 | |
| 1255 | AI_ERROR(cmd._message != Command::NoCommand); |
| 1256 | SendCommand(cmd, list, channelCenter); |
| 1257 | } |
| 1258 | |
| 1259 | void AIGroup::IssueAutoCommand(Command& cmd, AIUnit* unit) |
| 1260 | { |
no test coverage detected