diff --git a/src/init.cpp b/src/init.cpp index 55466a56a54de..b53e61c79fd6d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -512,6 +512,7 @@ void DynamicDataLoader::unload_data() reset_mapgens(); reset_effect_types(); reset_speech(); + reset_scenarios_blacklist(); overmap_land_use_codes::reset(); overmap_connections::reset(); overmap_locations::reset(); diff --git a/src/scenario.cpp b/src/scenario.cpp index 79a34fa2a4a3b..4f095057a826f 100644 --- a/src/scenario.cpp +++ b/src/scenario.cpp @@ -257,12 +257,12 @@ void scen_blacklist::load( const JsonObject &jo, const std::string & ) void scen_blacklist::finalize() { - std::vector> all_scenarios; + std::vector> all_scens; for( const scenario &scen : scenario::get_all() ) { - all_scenarios.emplace_back( scen.ident() ); + all_scens.emplace_back( scen.ident() ); } for( const string_id &sc : sc_blacklist.scenarios ) { - if( std::find( all_scenarios.begin(), all_scenarios.end(), sc ) == all_scenarios.end() ) { + if( std::find( all_scens.begin(), all_scens.end(), sc ) == all_scens.end() ) { debugmsg( "Scenario blacklist contains invalid scenario" ); } } @@ -283,6 +283,11 @@ void scen_blacklist::finalize() } } +void reset_scenarios_blacklist() +{ + sc_blacklist.scenarios.clear(); +} + std::vector> scenario::permitted_professions() const { if( !cached_permitted_professions.empty() ) { diff --git a/src/scenario.h b/src/scenario.h index 52f4822fd4347..cf5a2a9621e05 100644 --- a/src/scenario.h +++ b/src/scenario.h @@ -119,4 +119,6 @@ struct scen_blacklist { void finalize(); }; +void reset_scenarios_blacklist(); + #endif