MCPcopy Create free account
hub / github.com/DFHack/dfhack / setLaborValidity

Method setLaborValidity

library/modules/Units.cpp:1388–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1386}
1387
1388bool Units::setLaborValidity(df::unit_labor labor, bool isValid) {
1389 if (!is_valid_enum_item(labor) || labor == unit_labor::NONE)
1390 return false;
1391 auto entity = df::historical_entity::find(plotinfo->civ_id);
1392 if (!entity || !entity->entity_raw)
1393 return false;
1394 entity->entity_raw->jobs.permitted_labor[labor] = isValid;
1395 return true;
1396}
1397/*
1398static inline void adjust_speed_rating(int &rating, bool is_adventure, int value,
1399 int dwarf100, int dwarf200, int adv50, int adv75, int adv100, int adv200)

Callers

nothing calls this directly

Calls 2

is_valid_enum_itemFunction · 0.85
findFunction · 0.50

Tested by

no test coverage detected