------------------------------------------- CAN USE TECH POSITION --------------------------------------
| 2445 | } |
| 2446 | //------------------------------------------- CAN USE TECH POSITION -------------------------------------- |
| 2447 | static inline bool canUseTechPosition(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) |
| 2448 | { |
| 2449 | if ( !checkCommandibility ) |
| 2450 | Broodwar->setLastError(); |
| 2451 | else if ( !canCommand(thisUnit) ) |
| 2452 | return false; |
| 2453 | |
| 2454 | if ( checkCanIssueCommandType && !canUseTechWithOrWithoutTarget(thisUnit, false) ) |
| 2455 | return false; |
| 2456 | |
| 2457 | if ( !canUseTechWithOrWithoutTarget(thisUnit, tech, false, false) ) |
| 2458 | return false; |
| 2459 | if ( !tech.targetsPosition() ) |
| 2460 | return Broodwar->setLastError(Errors::Incompatible_TechType); |
| 2461 | |
| 2462 | return true; |
| 2463 | } |
| 2464 | static inline bool canUseTechPosition(Unit thisUnit, BWAPI::TechType tech, Position target, bool checkTargetsPositions, bool checkCanIssueCommandType, bool checkCommandibility) |
| 2465 | { |
| 2466 | if ( !checkCommandibility ) |
no test coverage detected