|
|
@ -905,7 +905,7 @@ bool isAssigned(df::unit* unit)
|
|
|
|
if( rtype == df::general_ref_type::BUILDING_CIVZONE_ASSIGNED
|
|
|
|
if( rtype == df::general_ref_type::BUILDING_CIVZONE_ASSIGNED
|
|
|
|
|| rtype == df::general_ref_type::BUILDING_CAGED
|
|
|
|
|| rtype == df::general_ref_type::BUILDING_CAGED
|
|
|
|
|| rtype == df::general_ref_type::BUILDING_CHAIN
|
|
|
|
|| rtype == df::general_ref_type::BUILDING_CHAIN
|
|
|
|
|| (rtype == df::general_ref_type::CONTAINED_IN_ITEM && isBuiltCageAtPos(unit->pos))
|
|
|
|
|| (rtype == df::general_ref_type::CONTAINED_IN_ITEM && isInBuiltCage(unit))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assigned = true;
|
|
|
|
assigned = true;
|
|
|
@ -958,10 +958,10 @@ bool isInBuiltCage(df::unit* unit)
|
|
|
|
df::building* building = world->buildings.all[b];
|
|
|
|
df::building* building = world->buildings.all[b];
|
|
|
|
if( building->getType() == building_type::Cage)
|
|
|
|
if( building->getType() == building_type::Cage)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
df::building_cagest* oldcage = (df::building_cagest*) building;
|
|
|
|
df::building_cagest* cage = (df::building_cagest*) building;
|
|
|
|
for(size_t oc=0; oc<oldcage->assigned_creature.size(); oc++)
|
|
|
|
for(size_t c=0; c<cage->assigned_creature.size(); c++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(oldcage->assigned_creature[oc] == unit->id)
|
|
|
|
if(cage->assigned_creature[c] == unit->id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
caged = true;
|
|
|
|
caged = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2769,7 +2769,9 @@ command_result autoButcher( color_ostream &out, bool verbose = false )
|
|
|
|
|| !isTame(unit)
|
|
|
|
|| !isTame(unit)
|
|
|
|
|| isWar(unit) // ignore war dogs etc
|
|
|
|
|| isWar(unit) // ignore war dogs etc
|
|
|
|
|| isHunter(unit) // ignore hunting dogs etc
|
|
|
|
|| isHunter(unit) // ignore hunting dogs etc
|
|
|
|
|| (isContainedInItem(unit) && hasValidMapPos(unit) && isBuiltCageAtPos(unit->pos))
|
|
|
|
// ignore creatures in built cages to leave zoos alone
|
|
|
|
|
|
|
|
// (TODO: allow some kind of slaughter cages which you can place near the butcher)
|
|
|
|
|
|
|
|
|| (isContainedInItem(unit) && isInBuiltCage(unit))
|
|
|
|
|| unit->name.has_name
|
|
|
|
|| unit->name.has_name
|
|
|
|
)
|
|
|
|
)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|