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

Function isFreeEgglayer

plugins/autonestbox.cpp:208–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static bool isFreeEgglayer(df::unit *unit) {
209 return Units::isActive(unit)
210 && !Units::isUndead(unit)
211 && Units::isFemale(unit)
212 && Units::isAdult(unit)
213 && unlikely_to_revert_to_wild(unit)
214 && Units::isOwnCiv(unit)
215 && Units::isEggLayer(unit)
216 && !isAssigned(unit)
217 && !Units::isGrazer(unit) // exclude grazing birds because they're messy
218 && !Units::isMerchant(unit) // don't steal merchant mounts
219 && !Units::isForest(unit); // don't steal birds from traders, they hate that
220}
221
222static df::general_ref_building_civzone_assignedst * createCivzoneRef() {
223 return (df::general_ref_building_civzone_assignedst *)

Callers 2

getFreeNestboxZonesFunction · 0.85
getFreeEggLayersFunction · 0.85

Calls 2

isAssignedFunction · 0.85

Tested by

no test coverage detected