Skip to content

Commit

Permalink
wb: prevent unit id conflics
Browse files Browse the repository at this point in the history
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.

(cherry-picked from commit 775f3ec)
  • Loading branch information
gfgtdf authored and Vultraz committed Oct 7, 2018
1 parent 2b118b0 commit 1d5a6bf
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/play_controller.cpp
Expand Up @@ -553,7 +553,6 @@ void play_controller::finish_side_turn()
}

mouse_handler_.deselect_hex();
resources::gameboard->unit_id_manager().reset_fake();
gamestate_->init_side_done() = false;
}

Expand Down

0 comments on commit 1d5a6bf

Please sign in to comment.