+2006-06-03
+ * fixed crash bug when number of custom graphic frames was set to zero
+
2006-05-30
* fixed some bugs when displaying title screens from info screen menu
-#define COMPILE_DATE_STRING "[2006-05-30 23:57]"
+#define COMPILE_DATE_STRING "[2006-06-03 20:34]"
#endif
#if 1
+ /* older game versions that wrote level files with CUS1 chunks used
+ different default push delay values (not yet stored in level file) */
+ element_info[element].push_delay_fixed = 2;
+ element_info[element].push_delay_random = 8;
+#else
/* needed for older levels (see src/init.c for details) */
element_info[element].push_delay_fixed = -1; /* initialize later */
element_info[element].push_delay_random = -1; /* initialize later */
/* initialize element properties for level editor etc. */
InitElementPropertiesEngine(level->game_version);
+ InitElementPropertiesAfterLoading(level->game_version);
}
static void LoadLevel_InitPlayfield(struct LevelInfo *level, char *filename)
tape.length_seconds = GetTapeLength();
#if 0
+ printf("::: tape file version: %d\n", tape.file_version);
printf("::: tape game version: %d\n", tape.game_version);
printf("::: tape engine version: %d\n", tape.engine_version);
#endif
{
if (!IS_CUSTOM_ELEMENT(i))
{
+#if 1
+ /* set default push delay values (corrected since version 3.0.7-1) */
+ if (game.engine_version < VERSION_IDENT(3,0,7,1))
+ {
+ element_info[i].push_delay_fixed = 2;
+ element_info[i].push_delay_random = 8;
+ }
+ else
+ {
+ element_info[i].push_delay_fixed = 8;
+ element_info[i].push_delay_random = 8;
+ }
+#else
element_info[i].push_delay_fixed = game.default_push_delay_fixed;
element_info[i].push_delay_random = game.default_push_delay_random;
+#endif
}
}
game.engine_version >= VERSION_IDENT(2,2,0,0))
old_element = Back[jx][jy];
+ /* checking here causes player to move into acid even if the current field
+ cannot be left to that direction */
#if 0
#if USE_FIXED_DONT_RUN_INTO
if (player_can_move && DONT_RUN_INTO(element))
#endif
#endif
+#if 1 /* ------------------------------ NEW ------------------------------ */
+
+ if (IS_WALKABLE(old_element) && !ACCESS_FROM(old_element, move_direction))
+ return MP_NO_ACTION; /* field has no opening in this direction */
+
+ if (IS_PASSABLE(old_element) && !ACCESS_FROM(old_element,opposite_direction))
+ return MP_NO_ACTION; /* field has no opening in this direction */
+
+#if USE_FIXED_DONT_RUN_INTO
+ if (player_can_move && element == EL_ACID && move_direction == MV_DOWN)
+ {
+ SplashAcid(x, y);
+ Feld[jx][jy] = EL_PLAYER_1;
+ InitMovingField(jx, jy, MV_DOWN);
+ Store[jx][jy] = EL_ACID;
+ ContinueMoving(jx, jy);
+ BuryPlayer(player);
+
+ return MP_DONT_RUN_INTO;
+ }
+#endif
+
+#if USE_FIXED_DONT_RUN_INTO
+ if (player_can_move && DONT_RUN_INTO(element))
+ {
+ TestIfPlayerRunsIntoBadThing(jx, jy, player->MovDir);
+
+ return MP_DONT_RUN_INTO;
+ }
+#endif
+
+#else /* ------------------------------ OLD ------------------------------ */
+
#if 1
#if USE_FIXED_DONT_RUN_INTO
if (player_can_move && DONT_RUN_INTO(element))
if (IS_PASSABLE(old_element) && !ACCESS_FROM(old_element,opposite_direction))
return MP_NO_ACTION; /* field has no opening in this direction */
+ /* checking here causes player to explode when moving into acid */
#if 1
#if USE_FIXED_DONT_RUN_INTO
if (player_can_move && element == EL_ACID && move_direction == MV_DOWN)
#endif
#endif
+#endif /* ------------------------------ END ------------------------------ */
+
#if 0
#if USE_FIXED_DONT_RUN_INTO
if (player_can_move && DONT_RUN_INTO(element))
else
graphic_info[graphic].anim_frames = 1;
+ if (graphic_info[graphic].anim_frames == 0) /* frames must be at least 1 */
+ graphic_info[graphic].anim_frames = 1;
+
graphic_info[graphic].anim_frames_per_line =
(parameter[GFX_ARG_FRAMES_PER_LINE] != ARG_UNDEFINED_VALUE ?
parameter[GFX_ARG_FRAMES_PER_LINE] : anim_frames_per_line);
engine_version > VERSION_IDENT(2,0,1,0)));
}
+#if 0
/* set default push delay values (corrected since version 3.0.7-1) */
if (engine_version < VERSION_IDENT(3,0,7,1))
{
game.default_push_delay_fixed = 8;
game.default_push_delay_random = 8;
}
+#endif
+#if 0
/* set uninitialized push delay values of custom elements in older levels */
for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
if (element_info[element].push_delay_random == -1)
element_info[element].push_delay_random = game.default_push_delay_random;
}
+#endif
+#if 0
/* set some other uninitialized values of custom elements in older levels */
if (engine_version < VERSION_IDENT(3,1,0,0))
{
element_info[element].ignition_delay = 8;
}
}
+#endif
#if 0
/* set element properties that were handled incorrectly in older levels */
InitElementGraphicInfo();
}
+void InitElementPropertiesAfterLoading(int engine_version)
+{
+ int i;
+
+#if 0
+ /* set default push delay values (corrected since version 3.0.7-1) */
+ if (engine_version < VERSION_IDENT(3,0,7,1))
+ {
+ game.default_push_delay_fixed = 2;
+ game.default_push_delay_random = 8;
+ }
+ else
+ {
+ game.default_push_delay_fixed = 8;
+ game.default_push_delay_random = 8;
+ }
+#endif
+
+#if 0
+ /* set uninitialized push delay values of custom elements in older levels */
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
+ {
+ int element = EL_CUSTOM_START + i;
+
+ if (element_info[element].push_delay_fixed == -1)
+ element_info[element].push_delay_fixed = game.default_push_delay_fixed;
+ if (element_info[element].push_delay_random == -1)
+ element_info[element].push_delay_random = game.default_push_delay_random;
+ }
+#endif
+
+#if 1
+ /* set some other uninitialized values of custom elements in older levels */
+ if (engine_version < VERSION_IDENT(3,1,0,0))
+ {
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
+ {
+ int element = EL_CUSTOM_START + i;
+
+ element_info[element].access_direction = MV_ALL_DIRECTIONS;
+
+ element_info[element].explosion_delay = 17;
+ element_info[element].ignition_delay = 8;
+ }
+ }
+#endif
+}
+
static void InitGlobal()
{
int i;
void InitElementPropertiesStatic(void);
void InitElementPropertiesEngine(int);
+void InitElementPropertiesAfterLoading(int);
void ReloadCustomArtwork(int);
void RedrawBackground();