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

Function canBuildAddon

bwapi/Shared/Templates.h:833–851  ·  view source on GitHub ↗

------------------------------------------- CAN BUILD ADDON --------------------------------------------

Source from the content-addressed store, hash-verified

831 }
832 //------------------------------------------- CAN BUILD ADDON --------------------------------------------
833 static inline bool canBuildAddon(Unit thisUnit, bool checkCommandibility = true)
834 {
835 if ( !checkCommandibility )
836 Broodwar->setLastError();
837 else if ( !canCommand(thisUnit) )
838 return false;
839
840 if ( thisUnit->isConstructing() ||
841 !thisUnit->isCompleted() ||
842 thisUnit->isLifted() ||
843 (thisUnit->getType().isBuilding() && !thisUnit->isIdle()) )
844 return Broodwar->setLastError(Errors::Unit_Busy);
845 if ( thisUnit->getAddon() )
846 return Broodwar->setLastError(Errors::Incompatible_State);
847 if ( !thisUnit->getType().canBuildAddon() )
848 return Broodwar->setLastError(Errors::Incompatible_UnitType);
849
850 return true;
851 }
852 static inline bool canBuildAddon(Unit thisUnit, UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true)
853 {
854 if ( !checkCommandibility )

Callers 3

canIssueCommandTypeFunction · 0.85
canIssueCommandFunction · 0.85
canBuildAddonMethod · 0.85

Calls 14

canCommandFunction · 0.85
setLastErrorMethod · 0.80
isConstructingMethod · 0.80
isCompletedMethod · 0.80
isLiftedMethod · 0.80
isBuildingMethod · 0.80
isIdleMethod · 0.80
getAddonMethod · 0.80
canMakeMethod · 0.80
isAddonMethod · 0.80
canBuildHereMethod · 0.80
getTilePositionMethod · 0.80

Tested by

no test coverage detected