fix compiler errors on non-windows systems

pull/679/head
lucaFiorini 2 months ago
parent 4ee6381a1f
commit 23b1a97bf3

@ -31,6 +31,7 @@
#include "gamelog.h" #include "gamelog.h"
#include "vehicle_base.h" #include "vehicle_base.h"
#include <string> #include <string>
#include <sstream>
#include <fstream> #include <fstream>
#include <streambuf> #include <streambuf>
@ -754,7 +755,7 @@ public:
case WID_SL_LOAD_BUTTON: { case WID_SL_LOAD_BUTTON: {
if (this->selected == nullptr || _load_check_data.HasErrors()) break; if (this->selected == nullptr || _load_check_data.HasErrors()) break;
_file_to_saveload.Set(*this->selected); _file_to_saveload.Set(*this->selected);
if (this->abstract_filetype == FT_HEIGHTMAP) { if (this->abstract_filetype == FT_HEIGHTMAP) {
@ -762,13 +763,17 @@ public:
ShowHeightmapLoad(); ShowHeightmapLoad();
}else if (this->abstract_filetype == FT_ORDERLIST) { }else if (this->abstract_filetype == FT_ORDERLIST) {
std::ifstream t(this->selected->name); FILE * file = FioFOpenFile(this->selected->name, "r", NO_DIRECTORY);
std::stringstream buffer;
buffer << t.rdbuf(); if (file != nullptr) {
std::ifstream t(file);
std::stringstream buffer;
buffer << t.rdbuf();
veh->orders->FromJSONString(veh, buffer.str()); veh->orders->FromJSONString(veh, buffer.str());
this->Close(); this->Close();
}
} else if (!_load_check_data.HasNewGrfs() || _load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs()) { } else if (!_load_check_data.HasNewGrfs() || _load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs()) {
_switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_SCENARIO : SM_LOAD_GAME; _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_SCENARIO : SM_LOAD_GAME;

Loading…
Cancel
Save