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:
9
pkg/win/build-scen.bat
Normal file
9
pkg/win/build-scen.bat
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
set Zip="C:\Program Files\7-Zip\7z.exe"
|
||||||
|
|
||||||
|
@echo Packing scenario %2...
|
||||||
|
if exist %2 del /F %2
|
||||||
|
if exist %2 exit 1
|
||||||
|
move %1 scenario
|
||||||
|
%Zip% a -ttar -so temp.tar scenario | %Zip% a -tgzip -si %2
|
||||||
|
move scenario %1
|
||||||
@@ -4,7 +4,6 @@ echo Copying files...
|
|||||||
set SolutionDir=%1
|
set SolutionDir=%1
|
||||||
set Config=%2
|
set Config=%2
|
||||||
set VCDir=%~f3
|
set VCDir=%~f3
|
||||||
set Zip="C:\Program Files\7-Zip\7z.exe"
|
|
||||||
|
|
||||||
|
|
||||||
set ResourceDir=%SolutionDir%%Config%\..\..\..\rsrc
|
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...
|
@echo Copying base scenarios...
|
||||||
cd %ResourceDir%\"Blades of Exile Bases"
|
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
|
xcopy %ResourceDir%\"Blades of Exile Bases"\*.boes %TargetDir%\"Blades of Exile Base" /s /y /i /d
|
||||||
|
|
||||||
@echo Copying scenario files...
|
@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) {
|
ticpp::Document xmlDocFromStream(std::istream& stream, std::string name) {
|
||||||
|
if(!stream) throw std::string("Error loading scenario file: ") + name;
|
||||||
std::string contents;
|
std::string contents;
|
||||||
stream.seekg(0, std::ios::end);
|
stream.seekg(0, std::ios::end);
|
||||||
contents.reserve(stream.tellg());
|
contents.reserve(stream.tellg());
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ map_data load_map(std::istream& fin, bool isTown, std::string name) {
|
|||||||
bool vehicle_owned;
|
bool vehicle_owned;
|
||||||
for(char c : line) {
|
for(char c : line) {
|
||||||
if(c == '#') break; // Found a comment
|
if(c == '#') break; // Found a comment
|
||||||
if(c == ' ' || c == '\t') continue;
|
if(isspace(c)) continue;
|
||||||
if(isdigit(c)) {
|
if(isdigit(c)) {
|
||||||
n *= 10;
|
n *= 10;
|
||||||
n += c - '0';
|
n += c - '0';
|
||||||
|
|||||||
Reference in New Issue
Block a user