| 1377 | } |
| 1378 | |
| 1379 | bool Units::isValidLabor(df::unit *unit, df::unit_labor labor) { |
| 1380 | CHECK_NULL_POINTER(unit); |
| 1381 | if (!is_valid_enum_item(labor) || labor == unit_labor::NONE) |
| 1382 | return false; |
| 1383 | |
| 1384 | auto entity = df::historical_entity::find(unit->civ_id); |
| 1385 | return !entity || !entity->entity_raw || entity->entity_raw->jobs.permitted_labor[labor]; |
| 1386 | } |
| 1387 | |
| 1388 | bool Units::setLaborValidity(df::unit_labor labor, bool isValid) { |
| 1389 | if (!is_valid_enum_item(labor) || labor == unit_labor::NONE) |
nothing calls this directly
no test coverage detected