Scenario editor can launch unpacked scenario

This commit is contained in:
2025-03-21 13:46:44 -05:00
parent fc36dcfd55
commit 7cce42ce12
7 changed files with 18 additions and 21 deletions

View File

@@ -26,7 +26,6 @@ void end_data_dump();
short onm(char x_sector,char y_sector);
std::vector<scen_header_type> build_scen_headers();
bool load_scenario_header(fs::path filename,scen_header_type& header_entry);
fs::path locate_scenario(std::string scen_name);
void alter_rect(rectangle *r);

View File

@@ -442,7 +442,7 @@ static void handle_scenario_args() {
// Add the scenario's path to the search paths put_party_in_scen() uses
extra_scen_dirs.push_back(path.parent_path());
}else{
path = locate_scenario(*scen_arg_path);
path = locate_scenario(*scen_arg_path, true);
}
cScenario scenario;
@@ -467,7 +467,7 @@ static void handle_scenario_args() {
resetting = true;
}
if(!univ.party.is_in_scenario()){
put_party_in_scen(path.filename().string(), scen_arg_town || scen_arg_out_sec);
put_party_in_scen(path.filename().string(), scen_arg_town || scen_arg_out_sec, true);
}
}else{
std::cerr << "Failed to load scenario: " << *scen_arg_path << std::endl;

View File

@@ -107,7 +107,7 @@ short store_pc_graphic;
// When the party is placed into a scen from the starting screen, this is called to put the game into game
// mode and load in the scen and init the party info
// party record already contains scen name
void put_party_in_scen(std::string scen_name, bool force) {
void put_party_in_scen(std::string scen_name, bool force, bool allow_unpacked) {
bool item_took = false;
// Drop debug mode
@@ -142,7 +142,7 @@ void put_party_in_scen(std::string scen_name, bool force) {
if(item_took)
cChoiceDlog("removed-special-items").show();
fs::path path = locate_scenario(scen_name);
fs::path path = locate_scenario(scen_name, allow_unpacked);
if(path.empty()) {
showError("Could not find scenario!");
return;

View File

@@ -47,7 +47,7 @@ short trait_present(eTrait which_trait);
short race_present(eRace which_race);
short wilderness_lore_present(ter_num_t ter);
void print_spell_cast(eSpell spell,eSkill which);
void put_party_in_scen(std::string scen_name, bool force = false);
void put_party_in_scen(std::string scen_name, bool force = false, bool allow_unpacked = false);
short party_size(bool only_living);
bool all_items_identified();