Skip to content

Commit 1c5f28f

Browse files
authored
Merge pull request #82629 from sparr/fix_map_extras_debug_no_verification
2 parents 8eccbd5 + 8ec3a44 commit 1c5f28f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/map_extras.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,20 +1538,21 @@ void map_extra::load( const JsonObject &jo, std::string_view )
15381538
}
15391539
}
15401540

1541+
void map_extra::finalize() const
1542+
{
1543+
if( generator_method != map_extra_method::null ) {
1544+
MapExtras::all_function_names.push_back( id );
1545+
}
1546+
}
1547+
15411548
void map_extra::check() const
15421549
{
15431550
switch( generator_method ) {
15441551
case map_extra_method::map_extra_function: {
15451552
const map_extra_pointer mx_func = MapExtras::get_function( map_extra_id( generator_id ) );
15461553
if( mx_func == nullptr ) {
15471554
debugmsg( "invalid map extra function (%s) defined for map extra (%s)", generator_id, id.str() );
1548-
break;
15491555
}
1550-
MapExtras::all_function_names.push_back( id );
1551-
break;
1552-
}
1553-
case map_extra_method::mapgen: {
1554-
MapExtras::all_function_names.push_back( id );
15551556
break;
15561557
}
15571558
case map_extra_method::update_mapgen: {
@@ -1560,11 +1561,10 @@ void map_extra::check() const
15601561
update_mapgen_func->second.funcs().empty() ) {
15611562
debugmsg( "invalid update mapgen function (%s) defined for map extra (%s)", generator_id,
15621563
id.str() );
1563-
break;
15641564
}
1565-
MapExtras::all_function_names.push_back( id );
15661565
break;
15671566
}
1567+
case map_extra_method::mapgen:
15681568
case map_extra_method::null:
15691569
default:
15701570
break;

src/map_extras.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class map_extra
7272
bool was_loaded = false;
7373
void load( const JsonObject &jo, std::string_view src );
7474
static void finalize_all();
75+
void finalize() const;
7576
void check() const;
7677
private:
7778
translation name_;

0 commit comments

Comments
 (0)