------------------------------------------- CAN USE TECH UNIT ------------------------------------------
| 2279 | } |
| 2280 | //------------------------------------------- CAN USE TECH UNIT ------------------------------------------ |
| 2281 | static inline bool canUseTechUnit(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) |
| 2282 | { |
| 2283 | if ( !checkCommandibility ) |
| 2284 | Broodwar->setLastError(); |
| 2285 | else if ( !canCommand(thisUnit) ) |
| 2286 | return false; |
| 2287 | |
| 2288 | if ( checkCanIssueCommandType && !canUseTechWithOrWithoutTarget(thisUnit, false) ) |
| 2289 | return false; |
| 2290 | |
| 2291 | if ( !canUseTechWithOrWithoutTarget(thisUnit, tech, false, false) ) |
| 2292 | return false; |
| 2293 | if ( !tech.targetsUnit() ) |
| 2294 | return Broodwar->setLastError(Errors::Incompatible_TechType); |
| 2295 | |
| 2296 | return true; |
| 2297 | } |
| 2298 | static inline bool canUseTechUnit(Unit thisUnit, BWAPI::TechType tech, Unit targetUnit, bool checkCanTargetUnit, bool checkTargetsUnits, bool checkCanIssueCommandType, bool checkCommandibility) |
| 2299 | { |
| 2300 | if ( !checkCommandibility ) |
no test coverage detected