Skip to content

Commit

Permalink
Merge pull request #76803 from HadeanLake/mandatory
Browse files Browse the repository at this point in the history
do not suppress missing/failed to load json error
  • Loading branch information
Maleclypse authored Oct 4, 2024
2 parents 4bad21f + 4e8392f commit 0c8023e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4629,8 +4629,8 @@ void field_type_migrations::load( const JsonObject &jo )
{
field_type_str_id from_field;
field_type_str_id to_field;
mandatory( jo, true, "from_field", from_field );
mandatory( jo, true, "to_field", to_field );
mandatory( jo, false, "from_field", from_field );
mandatory( jo, false, "to_field", to_field );
field_migrations.insert( std::make_pair( from_field, to_field ) );
}

Expand Down
8 changes: 4 additions & 4 deletions src/veh_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,10 +1697,10 @@ void vpart_category::reset()
void vpart_migration::load( const JsonObject &jo )
{
vpart_migration migration;
mandatory( jo, /* was_loaded = */ true, "from", migration.part_id_old );
mandatory( jo, /* was_loaded = */ true, "to", migration.part_id_new );
optional( jo, /* was_loaded = */ true, "variant", migration.variant );
optional( jo, /* was_loaded = */ true, "add_veh_tools", migration.add_veh_tools );
mandatory( jo, false, "from", migration.part_id_old );
mandatory( jo, false, "to", migration.part_id_new );
optional( jo, false, "variant", migration.variant );
optional( jo, false, "add_veh_tools", migration.add_veh_tools );
vpart_migrations.emplace( migration.part_id_old, migration );
}

Expand Down

0 comments on commit 0c8023e

Please sign in to comment.