Resolve bug #20299
Check IDs match before re-using an existing fake_unit. IDs can be different in the situation described by bug #20299, where the user selects the next unit while planning a move.
This commit is contained in:
parent
7e57ab0059
commit
3c4d8f1f67
1 changed files with 3 additions and 1 deletions
|
@ -713,7 +713,9 @@ void manager::create_temp_move()
|
|||
|
||||
if(path.size() >= 2)
|
||||
{
|
||||
if(!fake_unit)
|
||||
// Bug #20299 demonstrates a situation where an incorrect fake/ghosted unit can be used.
|
||||
// So before assuming that a pre-existing fake_unit can be re-used, check that its ID matches the unit being moved.
|
||||
if(!fake_unit || fake_unit.get_unit_ptr()->id() != temp_moved_unit->id())
|
||||
{
|
||||
// Create temp ghost unit
|
||||
fake_unit = fake_unit_ptr(unit_ptr (new unit(*temp_moved_unit)), resources::fake_units);
|
||||
|
|
Loading…
Add table
Reference in a new issue