Skip to content

Commit

Permalink
remove pointless loop left after refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Mar 6, 2021
1 parent 69879ff commit d7302b4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions plan_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ bool Plan::rescue_caged(color_ostream & out, room *r, furniture *f, int32_t item
break;
}
}
df::building_cagest* cage_bld = nullptr;
df::building_cagest *cage_bld = nullptr;
for (auto ref : cage->general_refs)
{
if (ref->getType() == general_ref_type::BUILDING_HOLDER)
Expand All @@ -545,13 +545,10 @@ bool Plan::rescue_caged(color_ostream & out, room *r, furniture *f, int32_t item
if (prisoner == nullptr)
{
// there's no longer someone in the cage.
for (auto ref : cage->general_refs)
// if we secured the cage to the floor, free it up.
if (cage_bld)
{
// if we secured the cage to the floor, free it up.
if (cage_bld)
{
Buildings::deconstruct(cage_bld);
}
Buildings::deconstruct(cage_bld);
}
return true;
}
Expand Down

0 comments on commit d7302b4

Please sign in to comment.