Fix the "-c" command line option.
Instead of checking the existing scenarios for a valid one (which always fails since the campaigns's scenarios aren't available at startup) just take the name for granted, because eventually we'll get an error 'Unknown scenario' if the ID doesn't exist.
This commit is contained in:
parent
7f1c3451d1
commit
eb5311cd1e
1 changed files with 1 additions and 14 deletions
15
src/game.cpp
15
src/game.cpp
|
@ -1122,21 +1122,8 @@ bool game_controller::new_campaign()
|
|||
if (jump_to_campaign_.scenario_id_.empty())
|
||||
state_.classification().scenario = campaign["first_scenario"].str();
|
||||
else
|
||||
{
|
||||
bool found = false;
|
||||
foreach(const config &sc, campaign.child_range("scenario"))
|
||||
{
|
||||
if (sc["id"] == jump_to_campaign_.scenario_id_)
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
std::cerr<<"No such scenario id to jump to: ["<<jump_to_campaign_.scenario_id_<<"]\n";
|
||||
return false;
|
||||
}
|
||||
state_.classification().scenario = jump_to_campaign_.scenario_id_;
|
||||
}
|
||||
|
||||
state_.classification().end_text = campaign["end_text"].str();
|
||||
state_.classification().end_text_duration = campaign["end_text_duration"];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue