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

Function canUseTechWithoutTarget

bwapi/Shared/Templates.h:2263–2279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2261 return true;
2262 }
2263 static inline bool canUseTechWithoutTarget(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType, bool checkCommandibility)
2264 {
2265 if ( !checkCommandibility )
2266 Broodwar->setLastError();
2267 else if ( !canCommand(thisUnit) )
2268 return false;
2269
2270 if ( checkCanIssueCommandType && !canUseTechWithOrWithoutTarget(thisUnit, false) )
2271 return false;
2272
2273 if ( !canUseTechWithOrWithoutTarget(thisUnit, tech, false, false) )
2274 return false;
2275 if ( tech.targetsUnit() || tech.targetsPosition() || tech == TechTypes::None || tech == TechTypes::Unknown || tech == TechTypes::Lurker_Aspect)
2276 return Broodwar->setLastError(Errors::Incompatible_TechType);
2277
2278 return true;
2279 }
2280 //------------------------------------------- CAN USE TECH UNIT ------------------------------------------
2281 static inline bool canUseTechUnit(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true)
2282 {

Callers 7

canBurrowFunction · 0.85
canCloakFunction · 0.85
canSiegeFunction · 0.85
canUseTechFunction · 0.85
canIssueCommandFunction · 0.85
canIssueCommandGroupedFunction · 0.85

Calls 5

canCommandFunction · 0.85
setLastErrorMethod · 0.80
targetsUnitMethod · 0.80
targetsPositionMethod · 0.80

Tested by

no test coverage detected