Mark file_to_load in load_party as const reference.
This commit is contained in:
@@ -21,7 +21,7 @@ class cUniverse;
|
||||
fs::path locate_scenario(std::string scen_name);
|
||||
bool load_scenario(fs::path file_to_load, cScenario& scenario, bool only_header = false);
|
||||
|
||||
bool load_party(fs::path file_to_load, cUniverse& univ);
|
||||
bool load_party(fs::path const &file_to_load, cUniverse& univ);
|
||||
bool save_party(fs::path dest_file, const cUniverse& univ);
|
||||
|
||||
void init_directories(const char* exec_path);
|
||||
|
@@ -24,10 +24,10 @@ extern fs::path progDir, tempDir;
|
||||
extern cCustomGraphics spec_scen_g;
|
||||
|
||||
// Load saved games
|
||||
static bool load_party_v1(fs::path file_to_load, cUniverse& univ, bool town_restore, bool in_scen, bool maps_there, bool mac_file);
|
||||
static bool load_party_v2(fs::path file_to_load, cUniverse& univ);
|
||||
static bool load_party_v1(fs::path const &file_to_load, cUniverse& univ, bool town_restore, bool in_scen, bool maps_there, bool mac_file);
|
||||
static bool load_party_v2(fs::path const &file_to_load, cUniverse& univ);
|
||||
|
||||
bool load_party(fs::path file_to_load, cUniverse& univ){
|
||||
bool load_party(fs::path const &file_to_load, cUniverse& univ){
|
||||
bool town_restore = false;
|
||||
bool maps_there = false;
|
||||
bool in_scen = false;
|
||||
@@ -105,7 +105,7 @@ bool load_party(fs::path file_to_load, cUniverse& univ){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool load_party_v1(fs::path file_to_load, cUniverse& real_univ, bool town_restore, bool in_scen, bool maps_there, bool mac_file){
|
||||
bool load_party_v1(fs::path const &file_to_load, cUniverse& real_univ, bool town_restore, bool in_scen, bool maps_there, bool mac_file){
|
||||
std::ifstream fin(file_to_load.string().c_str(), std::ios_base::binary);
|
||||
fin.seekg(3*sizeof(short),std::ios_base::beg); // skip the header, which is 6 bytes in the old format
|
||||
|
||||
@@ -256,7 +256,7 @@ bool load_party_v1(fs::path file_to_load, cUniverse& real_univ, bool town_restor
|
||||
}
|
||||
|
||||
extern fs::path scenDir;
|
||||
bool load_party_v2(fs::path file_to_load, cUniverse& real_univ){
|
||||
bool load_party_v2(fs::path const &file_to_load, cUniverse& real_univ){
|
||||
igzstream zin(file_to_load.string().c_str());
|
||||
tarball partyIn;
|
||||
partyIn.readFrom(zin);
|
||||
|
Reference in New Issue
Block a user