diff --git a/rsrc/schemas/monsters.xsd b/rsrc/schemas/monsters.xsd index 2a75ef48..01c47616 100644 --- a/rsrc/schemas/monsters.xsd +++ b/rsrc/schemas/monsters.xsd @@ -37,6 +37,14 @@ + + + + + + + + @@ -346,7 +354,7 @@ - + diff --git a/rsrc/schemas/scenario.xsd b/rsrc/schemas/scenario.xsd index bfa04887..fff9c513 100644 --- a/rsrc/schemas/scenario.xsd +++ b/rsrc/schemas/scenario.xsd @@ -355,7 +355,13 @@ - + + + + + + + diff --git a/rsrc/schemas/town.xsd b/rsrc/schemas/town.xsd index 4d2cad94..83886874 100644 --- a/rsrc/schemas/town.xsd +++ b/rsrc/schemas/town.xsd @@ -14,6 +14,14 @@ + + + + + + + + @@ -156,7 +164,7 @@ - + diff --git a/src/scenedit/scen.fileio.cpp b/src/scenedit/scen.fileio.cpp index 9a6c1941..a0ffd619 100644 --- a/src/scenedit/scen.fileio.cpp +++ b/src/scenedit/scen.fileio.cpp @@ -347,7 +347,7 @@ void writeScenarioToXml(ticpp::Printer&& data, cScenario& scenario) { for(int i = 0; i < scenario.snd_names.size(); i++) { if(scenario.snd_names[i].empty()) continue; data.OpenElement("sound"); - data.PushAttribute("id", i); + data.PushAttribute("id", i + 100); data.PushText(scenario.snd_names[i]); data.CloseElement("sound"); } diff --git a/src/tools/fileio_scen.cpp b/src/tools/fileio_scen.cpp index 62335ce9..0a8dac33 100644 --- a/src/tools/fileio_scen.cpp +++ b/src/tools/fileio_scen.cpp @@ -821,6 +821,9 @@ void readScenarioFromXml(ticpp::Document&& data, cScenario& scenario) { edit->GetText(&scenario.last_town_edited); } else if(type == "sound") { edit->GetAttribute("id", &sndnum); + if(sndnum < 100) + throw xBadVal(type, "id", std::to_string(sndnum), edit->Row(), edit->Column(), fname); + sndnum -= 100; if(sndnum >= scenario.snd_names.size()) scenario.snd_names.resize(sndnum + 1); edit->GetText(&scenario.snd_names[sndnum], false);