| 1744 | return true; |
| 1745 | } |
| 1746 | static inline bool canUnloadAtPosition(Unit thisUnit, Position targDropPos, bool checkCanIssueCommandType = true, bool checkCommandibility = true) |
| 1747 | { |
| 1748 | if ( !checkCommandibility ) |
| 1749 | Broodwar->setLastError(); |
| 1750 | else if ( !canCommand(thisUnit) ) |
| 1751 | return false; |
| 1752 | |
| 1753 | if ( checkCanIssueCommandType && !canUnloadWithOrWithoutTarget(thisUnit, false) ) |
| 1754 | return false; |
| 1755 | |
| 1756 | if ( thisUnit->getType() != UnitTypes::Terran_Bunker ) |
| 1757 | { |
| 1758 | if ( WalkPosition(targDropPos.x/8, targDropPos.y/8).isValid() == false ) |
| 1759 | return Broodwar->setLastError(Errors::Invalid_Tile_Position); |
| 1760 | else if ( !Broodwar->isWalkable(targDropPos.x/8, targDropPos.y/8) ) |
| 1761 | return Broodwar->setLastError(Errors::Unreachable_Location); |
| 1762 | } |
| 1763 | |
| 1764 | return true; |
| 1765 | } |
| 1766 | static inline bool canUnload(Unit thisUnit, bool checkCommandibility = true) |
| 1767 | { |
| 1768 | return canUnloadAtPosition(thisUnit, thisUnit->getPosition(), true, checkCommandibility); |
no test coverage detected