From: Holger Schemel Date: Wed, 12 May 2004 20:56:16 +0000 (+0200) Subject: rnd-20040512-1-src X-Git-Tag: 3.1.0^2~5 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1442f47fb19411923cba74dd8a7c17fef1fe5e0d;p=rocksndiamonds.git rnd-20040512-1-src * fixed bug with missing initialization of "modified" flag for GEs * fixed bug that caused endless recursion loop when relocating player * fixed tape recorder bug in "step mode" when using "pause before end" * fixed tape recorder bug when changing from "warp forward" mode * fixed bug with "when touching" for pushed elements at last position --- diff --git a/ChangeLog b/ChangeLog index f01f8f63..c73695bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-05-10 + * fixed bug with missing initialization of "modified" flag for GEs + +2004-05-09 + * fixed bug that caused endless recursion loop when relocating player + * fixed tape recorder bug in "step mode" when using "pause before end" + * fixed tape recorder bug when changing from "warp forward" mode + +2004-05-08 + * fixed bug with "when touching" for pushed elements at last position + 2004-05-05 * fixed bug that caused two activated toolbox buttons in level editor * fixed bug with exploding dynabomb under player due to other explosion diff --git a/src/conftime.h b/src/conftime.h index 5ee9111f..c163ee24 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-05-08 01:48]" +#define COMPILE_DATE_STRING "[2004-05-10 22:44]" diff --git a/src/files.c b/src/files.c index fa71b177..ccea3f94 100644 --- a/src/files.c +++ b/src/files.c @@ -228,6 +228,8 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) element_info[element].use_gfx_element = FALSE; element_info[element].gfx_element = EL_EMPTY_SPACE; + + element_info[element].modified_settings = FALSE; } if (IS_CUSTOM_ELEMENT(element) || @@ -282,8 +284,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) /* now set default properties */ SET_PROPERTY(element, EP_CAN_MOVE_INTO_ACID, TRUE); - - element_info[element].modified_settings = FALSE; } if (IS_GROUP_ELEMENT(element) || @@ -2272,7 +2272,7 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) } /* initialize "can_explode" field for old levels which did not store this */ - if (level->game_version <= VERSION_IDENT(3,1,0,2)) + if (level->game_version <= VERSION_IDENT(3,1,0,0)) { for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) { diff --git a/src/game.c b/src/game.c index 7496d0e0..13089ad4 100644 --- a/src/game.c +++ b/src/game.c @@ -2112,7 +2112,7 @@ void InitMovDir(int x, int y) { #if 1 /* use random direction as default start direction */ - if (game.engine_version >= VERSION_IDENT(3,1,0,2)) + if (game.engine_version >= VERSION_IDENT(3,1,0,0)) MovDir[x][y] = 1 << RND(4); #endif @@ -2923,10 +2923,20 @@ void RelocatePlayer(int jx, int jy, int el_player_raw) TestIfPlayerTouchesCustomElement(jx, jy); #endif -#if 1 +#if 0 + printf("::: %d,%d: %d\n", jx, jy-1, Changed[jx][jy-1]); +#endif + +#if 0 +#if 0 + /* needed to allow change of walkable custom element by entering player */ + if (!(Changed[jx][jy] & CH_EVENT_BIT(CE_ENTERED_BY_PLAYER))) + Changed[jx][jy] = 0; /* allow another change (but prevent loop) */ +#else /* needed to allow change of walkable custom element by entering player */ Changed[jx][jy] = 0; /* allow another change */ #endif +#endif #if 0 printf("::: player entering %d, %d from %s ...\n", jx, jy, @@ -5426,7 +5436,7 @@ void StartMoving(int x, int y) #if 1 if (game.engine_version >= VERSION_IDENT(3,1,0,0) && - CheckCollision[x][y] && IN_LEV_FIELD_AND_NOT_FREE(newx, newy)) + CheckCollision[x][y] && !IN_LEV_FIELD_AND_IS_FREE(newx, newy)) #else if (game.engine_version >= VERSION_IDENT(3,1,0,0) && WasJustMoving[x][y] && IN_LEV_FIELD(newx, newy) && @@ -7463,7 +7473,9 @@ static void ChangeElementNowExt(int x, int y, int target_element) DrawLevelFieldCrumbledSandNeighbours(x, y); } +#if 0 Changed[x][y] |= ChangeEvent[x][y]; /* ignore same changes in this frame */ +#endif #if 0 TestIfBadThingTouchesHero(x, y); @@ -7471,9 +7483,14 @@ static void ChangeElementNowExt(int x, int y, int target_element) TestIfElementTouchesCustomElement(x, y); #endif + /* "Changed[][]" not set yet to allow "entered by player" change one time */ if (ELEM_IS_PLAYER(target_element)) RelocatePlayer(x, y, target_element); +#if 1 + Changed[x][y] |= ChangeEvent[x][y]; /* ignore same changes in this frame */ +#endif + #if 1 TestIfBadThingTouchesHero(x, y); TestIfPlayerTouchesCustomElement(x, y); @@ -7560,6 +7577,16 @@ static boolean ChangeElementNow(int x, int y, int element, int page) continue; } +#if 0 + if (Changed[ex][ey]) /* do not change already changed elements */ + { + can_replace[xx][yy] = FALSE; + complete_replace = FALSE; + + continue; + } +#endif + e = Feld[ex][ey]; if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey)) @@ -9818,7 +9845,8 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) TestIfPlayerTouchesCustomElement(jx, jy); #if 1 #if 1 - /* needed because pushed element has not yet reached its destination */ + /* needed because pushed element has not yet reached its destination, + so it would trigger a change event at its previous field location */ if (!player->is_pushing) #endif TestIfElementTouchesCustomElement(jx, jy); /* for empty space */ @@ -11761,11 +11789,11 @@ boolean DropElement(struct PlayerInfo *player) nexty = dropy + GET_DY_FROM_DIR(move_direction); #if 1 - Changed[dropx][dropy] = 0; /* allow another change */ - CheckCollision[dropx][dropy] = 2; + Changed[dropx][dropy] = 0; /* allow another change */ + CheckCollision[dropx][dropy] = 2; #else - if (IN_LEV_FIELD(nextx, nexty) && IS_FREE(nextx, nexty)) + if (IN_LEV_FIELD_AND_IS_FREE(nextx, nexty)) { #if 0 WasJustMoving[dropx][dropy] = 3; @@ -11776,7 +11804,8 @@ boolean DropElement(struct PlayerInfo *player) #endif #endif } -#if 1 +#if 0 + /* !!! commented out from 3.1.0-4 to 3.1.0-5 !!! */ else { Changed[dropx][dropy] = 0; /* allow another change */ diff --git a/src/tape.c b/src/tape.c index d3fdd457..fb705a9f 100644 --- a/src/tape.c +++ b/src/tape.c @@ -962,7 +962,7 @@ byte *TapePlayAction() DrawVideoDisplay(VIDEO_STATE_WARP2_ON, VIDEO_DISPLAY_SYMBOL_ONLY); } - if (TimePlayed > tape.length_seconds - TAPE_PAUSE_SECONDS_BEFORE_DEATH) + if (TapeTime > tape.length_seconds - TAPE_PAUSE_SECONDS_BEFORE_DEATH) { TapeTogglePause(TAPE_TOGGLE_MANUAL); return NULL; @@ -1558,9 +1558,15 @@ static void HandleTapeButtons(struct GadgetInfo *gi) } else /* AUTO PAUSE -> NORMAL PLAY */ { +#if 1 + if (tape.warp_forward) + TapeStopWarpForward(); +#else + tape.warp_forward = FALSE; +#endif tape.fast_forward = FALSE; tape.pause_before_death = FALSE; - tape.warp_forward = FALSE; + #if 1 DrawVideoDisplay(VIDEO_STATE_PBEND_OFF | VIDEO_STATE_PLAY_ON, 0); #else