Fixup c8b0833
(crash when creating scenario in Editor)
There's no AI manager in the editor (a game state is required), nor a need for one, so I simply disabled the AI initialization if we're not in the editor.
This commit is contained in:
parent
e9e22f30b7
commit
3dc8617ec9
1 changed files with 8 additions and 4 deletions
12
src/team.cpp
12
src/team.cpp
|
@ -203,10 +203,14 @@ void team::team_info::read(const config& cfg)
|
||||||
if(!user_team_name.translatable())
|
if(!user_team_name.translatable())
|
||||||
user_team_name = t_string::from_serialized(user_team_name);
|
user_team_name = t_string::from_serialized(user_team_name);
|
||||||
|
|
||||||
if(cfg.has_attribute("ai_config")) {
|
display* disp = display::get_singleton();
|
||||||
ai::manager::get_singleton().add_ai_for_side_from_file(side, cfg["ai_config"], true);
|
|
||||||
} else {
|
if(disp && !disp->in_editor()) {
|
||||||
ai::manager::get_singleton().add_ai_for_side_from_config(side, cfg, true);
|
if(cfg.has_attribute("ai_config")) {
|
||||||
|
ai::manager::get_singleton().add_ai_for_side_from_file(side, cfg["ai_config"], true);
|
||||||
|
} else {
|
||||||
|
ai::manager::get_singleton().add_ai_for_side_from_config(side, cfg, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> recruits = utils::split(cfg["recruit"]);
|
std::vector<std::string> recruits = utils::split(cfg["recruit"]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue