------------------------------------------- CAN RIGHT CLICK UNIT ---------------------------------------
| 1947 | } |
| 1948 | //------------------------------------------- CAN RIGHT CLICK UNIT --------------------------------------- |
| 1949 | static inline bool canRightClickUnit(Unit thisUnit, bool checkCommandibility) |
| 1950 | { |
| 1951 | if ( !checkCommandibility ) |
| 1952 | Broodwar->setLastError(); |
| 1953 | else if ( !canCommand(thisUnit) ) |
| 1954 | return false; |
| 1955 | |
| 1956 | if ( !thisUnit->getType().isBuilding() && !thisUnit->isInterruptible() ) |
| 1957 | return Broodwar->setLastError(Errors::Unit_Busy); |
| 1958 | if ( !canFollow(thisUnit, false) && |
| 1959 | !canAttackUnit(thisUnit, false) && |
| 1960 | !canLoad(thisUnit, false) && |
| 1961 | !canSetRallyUnit(thisUnit, false) ) |
| 1962 | return Broodwar->setLastError(Errors::Incompatible_State); |
| 1963 | |
| 1964 | return true; |
| 1965 | } |
| 1966 | static inline bool canRightClickUnit(Unit thisUnit, Unit targetUnit, bool checkCanTargetUnit, bool checkCanIssueCommandType, bool checkCommandibility) |
| 1967 | { |
| 1968 | if ( !checkCommandibility ) |
no test coverage detected