| 57 | } |
| 58 | |
| 59 | void DevAIModule::onSendText(std::string text) |
| 60 | { |
| 61 | if (text == "/morph") |
| 62 | { |
| 63 | BWAPI::Unitset larvae = self->getUnits(); |
| 64 | larvae.erase_if(Filter::GetType != UnitTypes::Zerg_Larva); |
| 65 | if (!larvae.empty()) |
| 66 | { |
| 67 | if (!(*larvae.begin())->morph(UnitTypes::Zerg_Mutalisk)) |
| 68 | { |
| 69 | Broodwar << bw->getLastError() << ":" << self->incompleteUnitCount(UnitTypes::Zerg_Greater_Spire) << ":" << self->incompleteUnitCount(UnitTypes::Zerg_Spire) << std::endl; |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | Broodwar->sendText("%s", text.c_str()); |
| 74 | } |
| 75 | |
| 76 | void DevAIModule::onReceiveText(BWAPI::Player player, std::string text) |
| 77 | { |
nothing calls this directly
no test coverage detected