------------------------------------------- CAN USE TECH -----------------------------------------------
| 2150 | } |
| 2151 | //------------------------------------------- CAN USE TECH ----------------------------------------------- |
| 2152 | static inline bool canUseTechWithOrWithoutTarget(Unit thisUnit, bool checkCommandibility = true) |
| 2153 | { |
| 2154 | if ( !checkCommandibility ) |
| 2155 | Broodwar->setLastError(); |
| 2156 | else if ( !canCommand(thisUnit) ) |
| 2157 | return false; |
| 2158 | |
| 2159 | if ( !thisUnit->getType().isBuilding() && !thisUnit->isInterruptible() ) |
| 2160 | return Broodwar->setLastError(Errors::Unit_Busy); |
| 2161 | if ( !thisUnit->isCompleted() ) |
| 2162 | return Broodwar->setLastError(Errors::Incompatible_State); |
| 2163 | if ( thisUnit->isHallucination() ) |
| 2164 | return Broodwar->setLastError(Errors::Incompatible_UnitType); |
| 2165 | |
| 2166 | return true; |
| 2167 | } |
| 2168 | static inline bool canUseTechWithOrWithoutTarget(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) |
| 2169 | { |
| 2170 | if ( !checkCommandibility ) |
no test coverage detected