File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1538,20 +1538,21 @@ void map_extra::load( const JsonObject &jo, std::string_view )
1538
1538
}
1539
1539
}
1540
1540
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
+
1541
1548
void map_extra::check () const
1542
1549
{
1543
1550
switch ( generator_method ) {
1544
1551
case map_extra_method::map_extra_function: {
1545
1552
const map_extra_pointer mx_func = MapExtras::get_function ( map_extra_id ( generator_id ) );
1546
1553
if ( mx_func == nullptr ) {
1547
1554
debugmsg ( " invalid map extra function (%s) defined for map extra (%s)" , generator_id, id.str () );
1548
- break ;
1549
1555
}
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 );
1555
1556
break ;
1556
1557
}
1557
1558
case map_extra_method::update_mapgen: {
@@ -1560,11 +1561,10 @@ void map_extra::check() const
1560
1561
update_mapgen_func->second .funcs ().empty () ) {
1561
1562
debugmsg ( " invalid update mapgen function (%s) defined for map extra (%s)" , generator_id,
1562
1563
id.str () );
1563
- break ;
1564
1564
}
1565
- MapExtras::all_function_names.push_back ( id );
1566
1565
break ;
1567
1566
}
1567
+ case map_extra_method::mapgen:
1568
1568
case map_extra_method::null:
1569
1569
default :
1570
1570
break ;
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ class map_extra
72
72
bool was_loaded = false ;
73
73
void load ( const JsonObject &jo, std::string_view src );
74
74
static void finalize_all ();
75
+ void finalize () const ;
75
76
void check () const ;
76
77
private:
77
78
translation name_;
You can’t perform that action at this time.
0 commit comments