Skip to content

Commit

Permalink
Game Load: Use child_or_empty().
Browse files Browse the repository at this point in the history
Requested by @jyrkive.
  • Loading branch information
jostephd committed Sep 28, 2018
1 parent 1497dc5 commit adc5d4a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/save_index.cpp
Expand Up @@ -373,11 +373,7 @@ void extract_summary_from_config(config& cfg_save, config& cfg_summary)
cfg_summary["difficulty"] = cfg_save["difficulty"];
cfg_summary["random_mode"] = cfg_save["random_mode"];

if(cfg_save.has_child("multiplayer")) {
cfg_summary["active_mods"] = cfg_save.child("multiplayer")["active_mods"];
} else {
cfg_summary["active_mods"] = "";
}
cfg_summary["active_mods"] = cfg_save.child_or_empty("multiplayer")["active_mods"];
cfg_summary["campaign"] = cfg_save["campaign"];
cfg_summary["version"] = cfg_save["version"];
cfg_summary["corrupt"] = "";
Expand Down

0 comments on commit adc5d4a

Please sign in to comment.