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

Function canRightClickUnit

bwapi/Shared/Templates.h:1949–1965  ·  view source on GitHub ↗

------------------------------------------- CAN RIGHT CLICK UNIT ---------------------------------------

Source from the content-addressed store, hash-verified

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 )

Callers 4

canRightClickFunction · 0.85
canIssueCommandTypeFunction · 0.85
canIssueCommandFunction · 0.85
canRightClickUnitMethod · 0.85

Calls 13

canCommandFunction · 0.85
canFollowFunction · 0.85
canAttackUnitFunction · 0.85
canLoadFunction · 0.85
canSetRallyUnitFunction · 0.85
canTargetUnitFunction · 0.85
setLastErrorMethod · 0.80
isBuildingMethod · 0.80
isInterruptibleMethod · 0.80
getTypeMethod · 0.45
isNeutralMethod · 0.45
getPlayerMethod · 0.45

Tested by

no test coverage detected