@@ -144,7 +144,6 @@ enum { K_SCRIPT_LIST_DATA_VERSION_1 = 1,
144144 K_SCRIPT_CONDITION_VERSION_3 = 3 ,
145145 K_SCRIPT_CONDITION_VERSION_4 = 4 ,
146146 K_SCRIPTS_DATA_VERSION_1,
147- K_SCRIPT_GROUP_DATA_VERSION_3 = 3 ,
148147 K_SCRIPT_DATA_VERSION_3 = 3 ,
149148 end_of_the_enumeration
150149};
@@ -858,7 +857,7 @@ void ScriptGroup::WriteGroupDataChunk(DataChunkOutput &chunkWriter, ScriptGroup
858857
859858 /* *********SCRIPT GROUP DATA ***********************/
860859 while (pGroup) {
861- chunkWriter.openDataChunk (" ScriptGroup" , K_SCRIPT_GROUP_DATA_VERSION_3 );
860+ chunkWriter.openDataChunk (" ScriptGroup" , K_SCRIPT_GROUP_DATA_VERSION_2 );
862861 chunkWriter.writeAsciiString (pGroup->m_groupName );
863862 chunkWriter.writeByte (pGroup->m_isGroupActive );
864863 chunkWriter.writeByte (pGroup->m_isGroupSubroutine );
@@ -883,7 +882,7 @@ Bool ScriptGroup::ParseGroupDataChunk(DataChunkInput &file, DataChunkInfo *info,
883882
884883 pGroup->m_groupName = file.readAsciiString ();
885884 pGroup->m_isGroupActive = file.readByte ();
886- if (info->version = = K_SCRIPT_GROUP_DATA_VERSION_2) {
885+ if (info->version > = K_SCRIPT_GROUP_DATA_VERSION_2) {
887886 pGroup->m_isGroupSubroutine = file.readByte ();
888887 }
889888 pList->addGroup (pGroup, AT_END);
@@ -1227,9 +1226,11 @@ void Script::WriteScriptDataChunk(DataChunkOutput &chunkWriter, Script *pScript)
12271226 chunkWriter.writeByte (pScript->m_easy );
12281227 chunkWriter.writeByte (pScript->m_normal );
12291228 chunkWriter.writeByte (pScript->m_hard );
1229+
12301230 chunkWriter.writeByte (pScript->m_brutal ); // NEW
12311231 chunkWriter.writeByte (pScript->m_absurd ); // NEW
12321232 chunkWriter.writeByte (pScript->m_inhumane ); // NEW
1233+
12331234 chunkWriter.writeByte (pScript->m_isSubroutine );
12341235 chunkWriter.writeInt (pScript->m_delayEvaluationSeconds );
12351236 if (pScript->m_condition ) OrCondition::WriteOrConditionDataChunk (chunkWriter, pScript->m_condition );
@@ -1271,7 +1272,7 @@ Script *Script::ParseScript(DataChunkInput &file, unsigned short version)
12711272 pScript->m_inhumane = file.readByte ();
12721273 }
12731274 else {
1274- // Default: old maps shouldn't run scripts on new difficulties
1275+ // Default: old maps with old scripts shouldn't run scripts on new difficulties
12751276 pScript->m_brutal = false ;
12761277 pScript->m_absurd = false ;
12771278 pScript->m_inhumane = false ;
@@ -1282,9 +1283,9 @@ Script *Script::ParseScript(DataChunkInput &file, unsigned short version)
12821283 // -------------------------------------------------------------------------------------------------
12831284
12841285 pScript->m_isSubroutine = file.readByte ();
1285- if (version>=K_SCRIPT_DATA_VERSION_2) {
1286- pScript->m_delayEvaluationSeconds = file.readInt ();
1287- }
1286+
1287+ pScript->m_delayEvaluationSeconds = file.readInt ();
1288+
12881289 file.registerParser ( " OrCondition" , " Script" , OrCondition::ParseOrConditionDataChunk );
12891290 file.registerParser ( " ScriptAction" , " Script" , ScriptAction::ParseActionDataChunk );
12901291 file.registerParser ( " ScriptActionFalse" , " Script" , ScriptAction::ParseActionFalseDataChunk );
0 commit comments