Avoid side placement OOS by using std::stable_sort

Use of std::sort sometimes led to clients sorting placings with equal scores differently, leading to OOS when clients placed sides in different castles.
This commit is contained in:
Lari Nieminen 2015-09-09 11:13:49 +03:00
parent 2cdcae6294
commit cc9cf1a8a5

View file

@ -115,7 +115,7 @@ void game_state::place_sides_in_preferred_locations()
++side_num;
}
std::sort(placings.begin(),placings.end());
std::stable_sort(placings.begin(),placings.end());
std::set<int> placed;
std::set<map_location> positions_taken;