Fix zone tool

develop
Petr Mrázek 2012-04-05 03:00:10 +02:00
parent b8ccb0424d
commit 330118ee27
1 changed files with 3 additions and 3 deletions

@ -799,12 +799,12 @@ df::unit * findFreeEgglayer()
bool unassignUnitFromZone(df::unit* unit)
{
bool success = false;
for (size_t or = 0; or < unit->refs.size(); or++)
for (std::size_t idx = 0; idx < unit->refs.size(); idx++)
{
df::general_ref * oldref = unit->refs[or];
df::general_ref * oldref = unit->refs[idx];
if(oldref->getType() == df::general_ref_type::BUILDING_CIVZONE_ASSIGNED)
{
unit->refs.erase(unit->refs.begin() + or);
unit->refs.erase(unit->refs.begin() + idx);
df::building_civzonest * oldciv = (df::building_civzonest *) oldref->getBuilding();
for(size_t oc=0; oc<oldciv->assigned_creature.size(); oc++)
{