Whiteboard: scoped_planned_unit_map now only removes...
...the planned unit map if it wasn't set when it was created.
This commit is contained in:
parent
def4e4a50f
commit
022d028fbc
2 changed files with 4 additions and 2 deletions
|
@ -498,14 +498,15 @@ unit* manager::selected_unit()
|
|||
}
|
||||
|
||||
scoped_planned_unit_map::scoped_planned_unit_map()
|
||||
:has_planned_unit_map_(resources::whiteboard->has_planned_unit_map())
|
||||
{
|
||||
if (!resources::whiteboard->has_planned_unit_map())
|
||||
if (!has_planned_unit_map_)
|
||||
resources::whiteboard->set_planned_unit_map();
|
||||
}
|
||||
|
||||
scoped_planned_unit_map::~scoped_planned_unit_map()
|
||||
{
|
||||
if (resources::whiteboard->has_planned_unit_map())
|
||||
if (!has_planned_unit_map_)
|
||||
resources::whiteboard->set_real_unit_map();
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ struct scoped_planned_unit_map
|
|||
{
|
||||
scoped_planned_unit_map();
|
||||
~scoped_planned_unit_map();
|
||||
bool has_planned_unit_map_;
|
||||
};
|
||||
|
||||
/** Ensures that the real unit map is active for the duration of the struct's life,
|
||||
|
|
Loading…
Add table
Reference in a new issue