diff options
author | hop311 <hop3114@gmail.com> | 2024-01-22 20:17:38 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-01-22 20:25:09 +0100 |
commit | caa2f31d536f568e485f15537db5e2f79f7616d5 (patch) | |
tree | 7cd8a379963af18c24f8dabfe7525b39f2333e0c /src/openvic-simulation/military/Deployment.cpp | |
parent | 8205732a1b95f018f0898a2a4bc62e22f5bee0d3 (diff) |
Miscellaneous bug fixes and format cleanupmisc-changes
Diffstat (limited to 'src/openvic-simulation/military/Deployment.cpp')
-rw-r--r-- | src/openvic-simulation/military/Deployment.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/openvic-simulation/military/Deployment.cpp b/src/openvic-simulation/military/Deployment.cpp index d4a092b..c06ed95 100644 --- a/src/openvic-simulation/military/Deployment.cpp +++ b/src/openvic-simulation/military/Deployment.cpp @@ -82,22 +82,26 @@ bool DeploymentManager::load_oob_file( "name", ONE_EXACTLY, expect_identifier_or_string(assign_variable_callback(leader_name)), "date", ONE_EXACTLY, expect_identifier_or_string(expect_date_str(assign_variable_callback(leader_date))), "type", ONE_EXACTLY, expect_identifier(UnitManager::expect_type_str(assign_variable_callback(leader_type))), - "personality", ONE_EXACTLY, game_manager.get_military_manager().get_leader_trait_manager() - .expect_leader_trait_identifier(assign_variable_callback_pointer(leader_personality)), - "background", ONE_EXACTLY, game_manager.get_military_manager().get_leader_trait_manager() - .expect_leader_trait_identifier(assign_variable_callback_pointer(leader_background)), + "personality", ONE_EXACTLY, + game_manager.get_military_manager().get_leader_trait_manager().expect_leader_trait_identifier_or_string( + assign_variable_callback_pointer(leader_personality) + ), + "background", ONE_EXACTLY, + game_manager.get_military_manager().get_leader_trait_manager().expect_leader_trait_identifier_or_string( + assign_variable_callback_pointer(leader_background) + ), "prestige", ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(leader_prestige)), "picture", ZERO_OR_ONE, expect_identifier_or_string(assign_variable_callback(picture)) )(node); - if (!leader_personality->is_personality_trait()) { + if (leader_personality != nullptr && !leader_personality->is_personality_trait()) { Logger::error( "Leader ", leader_name, " has personality ", leader_personality->get_identifier(), " which is not a personality trait!" ); ret = false; } - if (!leader_background->is_background_trait()) { + if (leader_background != nullptr && !leader_background->is_background_trait()) { Logger::error( "Leader ", leader_name, " has background ", leader_background->get_identifier(), " which is not a background trait!" |