MCPcopy Create free account
hub / github.com/bwapi/bwapi / canUnloadAtPosition

Function canUnloadAtPosition

bwapi/Shared/Templates.h:1746–1765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 4

canUnloadFunction · 0.85
canUnloadAllFunction · 0.85
canUnloadAllPositionFunction · 0.85
canUnloadAtPositionMethod · 0.85

Calls 6

canCommandFunction · 0.85
setLastErrorMethod · 0.80
getTypeMethod · 0.45
isValidMethod · 0.45
isWalkableMethod · 0.45

Tested by

no test coverage detected