Fix some issues when loading new-format scenarios
- Carriage returns misinterpreted as map features - Error code returned by CopyFiles - Confusing error message when a file is missing in the archive
This commit is contained in:
@@ -4,7 +4,6 @@ echo Copying files...
|
||||
set SolutionDir=%1
|
||||
set Config=%2
|
||||
set VCDir=%~f3
|
||||
set Zip="C:\Program Files\7-Zip\7z.exe"
|
||||
|
||||
|
||||
set ResourceDir=%SolutionDir%%Config%\..\..\..\rsrc
|
||||
@@ -35,7 +34,7 @@ xcopy %ResourceDir%\..\src\tools\mask.* %TargetDir%\data\shaders /s /y /i /d
|
||||
|
||||
@echo Copying base scenarios...
|
||||
cd %ResourceDir%\"Blades of Exile Bases"
|
||||
%Zip% a -ttar -so bladbase.tar bladbase | %Zip% a -tgzip -si bladbase.boes
|
||||
%ResourceDir%\..\pkg\win\build-scen.bat bladbase bladbase.boes
|
||||
xcopy %ResourceDir%\"Blades of Exile Bases"\*.boes %TargetDir%\"Blades of Exile Base" /s /y /i /d
|
||||
|
||||
@echo Copying scenario files...
|
||||
|
@@ -296,6 +296,7 @@ bool load_scenario_v1(fs::path file_to_load, cScenario& scenario, bool only_head
|
||||
}
|
||||
|
||||
ticpp::Document xmlDocFromStream(std::istream& stream, std::string name) {
|
||||
if(!stream) throw std::string("Error loading scenario file: ") + name;
|
||||
std::string contents;
|
||||
stream.seekg(0, std::ios::end);
|
||||
contents.reserve(stream.tellg());
|
||||
|
@@ -30,7 +30,7 @@ map_data load_map(std::istream& fin, bool isTown, std::string name) {
|
||||
bool vehicle_owned;
|
||||
for(char c : line) {
|
||||
if(c == '#') break; // Found a comment
|
||||
if(c == ' ' || c == '\t') continue;
|
||||
if(isspace(c)) continue;
|
||||
if(isdigit(c)) {
|
||||
n *= 10;
|
||||
n += c - '0';
|
||||
|
Reference in New Issue
Block a user