Skip to content

Commit

Permalink
Make parameter offset of load_mapgen_function mandatory.
Browse files Browse the repository at this point in the history
Adds the default value to all calls to it that did not supply a value.
  • Loading branch information
BevapDin committed Feb 2, 2020
1 parent 7793608 commit 0c650d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void load_mapgen( const JsonObject &jo )
}
if( !mapgenid_list.empty() ) {
const std::string mapgenid = mapgenid_list[0];
const auto mgfunc = load_mapgen_function( jo, mapgenid, -1 );
const auto mgfunc = load_mapgen_function( jo, mapgenid, -1, point_zero );
if( mgfunc ) {
for( auto &i : mapgenid_list ) {
oter_mapgen.add( i, mgfunc );
Expand All @@ -514,7 +514,7 @@ void load_mapgen( const JsonObject &jo )
}
}
} else if( jo.has_string( "om_terrain" ) ) {
load_mapgen_function( jo, jo.get_string( "om_terrain" ), -1 );
load_mapgen_function( jo, jo.get_string( "om_terrain" ), -1, point_zero );
} else if( jo.has_string( "nested_mapgen_id" ) ) {
load_nested_mapgen( jo, jo.get_string( "nested_mapgen_id" ) );
} else if( jo.has_string( "update_mapgen_id" ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/mapgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class mapgen_function_json_nested : public mapgen_function_json_base
* Load mapgen function of any type from a json object
*/
std::shared_ptr<mapgen_function> load_mapgen_function( const JsonObject &jio,
const std::string &id_base, int default_idx, const point &offset = point_zero );
const std::string &id_base, int default_idx, const point &offset );
/*
* Load the above directly from a file via init, as opposed to riders attached to overmap_terrain. Added check
* for oter_mapgen key, multiple possible ( ie, [ "house", "house_base" ] )
Expand Down
2 changes: 1 addition & 1 deletion src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static void load_overmap_terrain_mapgens( const JsonObject &jo, const std::strin
}
if( jo.has_array( jsonkey ) ) {
for( JsonObject jio : jo.get_array( jsonkey ) ) {
load_mapgen_function( jio, fmapkey, default_idx );
load_mapgen_function( jio, fmapkey, default_idx, point_zero );
}
}
}
Expand Down

0 comments on commit 0c650d1

Please sign in to comment.