BorderElement = EL_STEELWALL;
+ /* detect custom elements when loading them */
+ level->file_has_custom_elements = FALSE;
+
/* set all bug compatibility flags to "false" => do not emulate this bug */
level->use_action_after_change_bug = FALSE;
element_info[element].push_delay_random = 8;
}
+ level->file_has_custom_elements = TRUE;
+
return chunk_size;
}
Error(ERR_WARN, "invalid custom element number %d", element);
}
+ level->file_has_custom_elements = TRUE;
+
return chunk_size;
}
ei->modified_settings = TRUE;
}
+ level->file_has_custom_elements = TRUE;
+
return chunk_size;
}
/* mark this custom element as modified */
ei->modified_settings = TRUE;
+ level->file_has_custom_elements = TRUE;
+
return chunk_size;
}
/* mark this group element as modified */
element_info[element].modified_settings = TRUE;
+ level->file_has_custom_elements = TRUE;
+
return chunk_size;
}
break;
}
+ level->file_has_custom_elements = TRUE;
+
return real_chunk_size;
}
*ei = xx_ei;
*group = xx_group;
+ level->file_has_custom_elements = TRUE;
+
return real_chunk_size;
}
level->em_explodes_by_fire = TRUE;
}
-static void LoadLevel_InitElements(struct LevelInfo *level, char *filename)
+static void LoadLevel_InitStandardElements(struct LevelInfo *level)
{
- int i, j, x, y;
+ int i, x, y;
+
+ /* map elements that have changed in newer versions */
+ level->amoeba_content = getMappedElementByVersion(level->amoeba_content,
+ level->game_version);
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ for (x = 0; x < 3; x++)
+ for (y = 0; y < 3; y++)
+ level->yamyam_content[i].e[x][y] =
+ getMappedElementByVersion(level->yamyam_content[i].e[x][y],
+ level->game_version);
+
+}
+
+static void LoadLevel_InitCustomElements(struct LevelInfo *level)
+{
+ int i, j;
/* map custom element change events that have changed in newer versions
(these following values were accidentally changed in version 3.0.1)
}
}
}
+}
- /* map elements that have changed in newer versions */
- level->amoeba_content = getMappedElementByVersion(level->amoeba_content,
- level->game_version);
- for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
- for (x = 0; x < 3; x++)
- for (y = 0; y < 3; y++)
- level->yamyam_content[i].e[x][y] =
- getMappedElementByVersion(level->yamyam_content[i].e[x][y],
- level->game_version);
+static void LoadLevel_InitElements(struct LevelInfo *level, char *filename)
+{
+ LoadLevel_InitStandardElements(level);
+
+ if (level->file_has_custom_elements)
+ LoadLevel_InitCustomElements(level);
+
+ if (level->file_has_custom_elements)
+ InitElementPropertiesAfterLoading(level->game_version);
/* initialize element properties for level editor etc. */
InitElementPropertiesEngine(level->game_version);
- InitElementPropertiesAfterLoading(level->game_version);
InitElementPropertiesGfxElement();
}