| 2261 | return true; |
| 2262 | } |
| 2263 | static inline bool canUseTechWithoutTarget(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType, bool checkCommandibility) |
| 2264 | { |
| 2265 | if ( !checkCommandibility ) |
| 2266 | Broodwar->setLastError(); |
| 2267 | else if ( !canCommand(thisUnit) ) |
| 2268 | return false; |
| 2269 | |
| 2270 | if ( checkCanIssueCommandType && !canUseTechWithOrWithoutTarget(thisUnit, false) ) |
| 2271 | return false; |
| 2272 | |
| 2273 | if ( !canUseTechWithOrWithoutTarget(thisUnit, tech, false, false) ) |
| 2274 | return false; |
| 2275 | if ( tech.targetsUnit() || tech.targetsPosition() || tech == TechTypes::None || tech == TechTypes::Unknown || tech == TechTypes::Lurker_Aspect) |
| 2276 | return Broodwar->setLastError(Errors::Incompatible_TechType); |
| 2277 | |
| 2278 | return true; |
| 2279 | } |
| 2280 | //------------------------------------------- CAN USE TECH UNIT ------------------------------------------ |
| 2281 | static inline bool canUseTechUnit(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) |
| 2282 | { |
no test coverage detected