static void LoadLevel_InitLevel(struct LevelInfo *level, char *filename)
{
- int x, y;
+ int i, j, x, y;
if (leveldir_current == NULL) /* only when dumping level */
return;
+ /* determine correct game engine version of current level */
if (IS_LEVELCLASS_CONTRIBUTION(leveldir_current) ||
IS_LEVELCLASS_USER(leveldir_current))
{
#if 0
- printf("::: This level is private or contributed: '%s'\n", filename);
+ printf("\n::: This level is private or contributed: '%s'\n", filename);
#endif
/* For user contributed and private levels, use the version of
else
{
#if 0
- printf("::: ALWAYS USE LATEST ENGINE FOR THIS LEVEL: [%d] '%s'\n",
+ printf("\n::: ALWAYS USE LATEST ENGINE FOR THIS LEVEL: [%d] '%s'\n",
leveldir_current->sort_priority, filename);
#endif
level->em_slippery_gems = TRUE;
}
- /* map elements which have changed in newer versions */
+ /* map elements that have changed in newer versions */
for(y=0; y<level->fieldy; y++)
{
for(x=0; x<level->fieldx; x++)
}
}
+ /* map custom element change events that have changed in newer versions
+ (these following values have accidentally changed in version 3.0.1) */
+ if (level->game_version <= VERSION_IDENT(3,0,0))
+ {
+ for (i=0; i < NUM_CUSTOM_ELEMENTS; i++)
+ {
+ int element = EL_CUSTOM_START + i;
+
+ /* order of checking events to be mapped is important */
+ for (j=CE_BY_OTHER; j >= CE_BY_PLAYER; j--)
+ {
+ if (HAS_CHANGE_EVENT(element, j - 2))
+ {
+ SET_CHANGE_EVENT(element, j - 2, FALSE);
+ SET_CHANGE_EVENT(element, j, TRUE);
+ }
+ }
+
+ /* order of checking events to be mapped is important */
+ for (j=CE_OTHER_GETS_COLLECTED; j >= CE_COLLISION; j--)
+ {
+ if (HAS_CHANGE_EVENT(element, j - 1))
+ {
+ SET_CHANGE_EVENT(element, j - 1, FALSE);
+ SET_CHANGE_EVENT(element, j, TRUE);
+ }
+ }
+ }
+ }
+
/* copy elements to runtime playfield array */
for(x=0; x<MAX_LEV_FIELDX; x++)
for(y=0; y<MAX_LEV_FIELDY; y++)
engine_version = getFileVersion(file);
if (engine_version > 0)
tape->engine_version = engine_version;
+ else
+ tape->engine_version = tape->game_version;
}
return chunk_size;
tape.length_seconds = GetTapeLength();
#if 0
- printf("tape version: %d\n", tape.game_version);
+ printf("tape game version: %d\n", tape.game_version);
+ printf("tape engine version: %d\n", tape.engine_version);
#endif
}
(PROPERTY_VAR(e,p) &= ~PROPERTY_BIT(p)))
-/* values for change events for custom elements */
+/* values for change events for custom elements (stored in level file) */
#define CE_DELAY 0
#define CE_TOUCHED_BY_PLAYER 1
#define CE_PRESSED_BY_PLAYER 2
#define CE_OTHER_GETS_COLLECTED 14
#define CE_OTHER_GETS_DROPPED 15
-/* values for internal purpose only (level editor) */
+/* values for activating change events (also stored in level file!) */
#define CE_BY_PLAYER 16
#define CE_BY_COLLISION 17
#define CE_BY_OTHER 18
#define PROGRAM_VERSION_MAJOR 3
#define PROGRAM_VERSION_MINOR 0
-#define PROGRAM_VERSION_PATCH 1
+#define PROGRAM_VERSION_PATCH 2
#define PROGRAM_VERSION_RELEASE 0
-#define PROGRAM_VERSION_STRING "3.0.1"
+#define PROGRAM_VERSION_STRING "3.0.2"
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define PROGRAM_AUTHOR_STRING "Holger Schemel"