Fixes bug #15380 (cl in multiplayer local game doesn't work).

This assumes that within the game_config object, mp campaign scenarios
are given in the right order. If that is not the case, the algorithm
would have to be modified to account for that.
This commit is contained in:
Jörg Hinrichs 2010-02-23 00:28:06 +00:00
parent 53105be56f
commit 06b33bd466
2 changed files with 17 additions and 0 deletions

View file

@ -12,6 +12,7 @@ Version 1.7.13+svn:
campaigns
* Fixed bug 14754: Host can start game before the client has selected a
leader (Debian bug #555964)
* Fix bug #15380 (cl in multiplayer local game doesn't work)
* Fix bug #15382 (Player doesn't get transported to the next scenario)
* Fix bug #15383 (Multiplayer Campaigns can't be loaded from savegame)
* Fix bug #15391 (Warnings in multiplayer games)

View file

@ -3090,6 +3090,22 @@ void console_handler::do_choose_level() {
next = nb;
++nb;
}
// find scenarios of multiplayer campaigns
// (assumes that scenarios are ordered properly in the game_config)
std::string& scenario = menu_handler_.gamestate_.mp_settings().mp_scenario;
foreach (const config &mp, menu_handler_.game_config_.child_range("multiplayer"))
{
if (mp["id"] == scenario)
{
const std::string &id = mp["id"];
options.push_back(id);
if (id == menu_handler_.gamestate_.classification().next_scenario)
next = nb;
++nb;
scenario = mp["next_scenario"];
}
}
std::sort(options.begin(), options.end());
int choice = 0;
{
gui::dialog menu(*menu_handler_.gui_, _("Choose Scenario (Debug!)"), "", gui::OK_CANCEL);