CanAfford¶
Check afford in current game state.
CanAfford(objectType, isBuilding)
Inputs: objectType is an integer UnitObjectType ID; isBuilding is boolean choosing building or unit affordability.
Output: true when the assigned player can afford an object.
Errors and unavailable states: Wrong argument types can raise a Lua argument error. This call has no separate error return; check the live game state before depending on its result.
See Game data and world for related calls and usage notes.