From: Holger Schemel Date: Tue, 9 Mar 2004 01:23:27 +0000 (+0100) Subject: rnd-20040309-1-src X-Git-Tag: 3.1.0^2~55 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=73dfe4a920cabf20138c0ba49964a3c8c3f752d0;p=rocksndiamonds.git rnd-20040309-1-src * fixed totally broken (every 8th frame skipped) step-by-step recording * fixed bug with requester not displayed when quick-loading interrupted * fixed bug which messed up key config when using keypad number keys --- diff --git a/ChangeLog b/ChangeLog index 973ddb6c..83532d96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-03-08 + * fixed totally broken (every 8th frame skipped) step-by-step recording + * fixed bug with requester not displayed when quick-loading interrupted + +2004-03-07 + * fixed bug which messed up key config when using keypad number keys + 2004-03-03 * fixed bug which allowed moving upwards even when gravity was active * fixed bug with missing error handling when dumping levels or tapes diff --git a/src/conftime.h b/src/conftime.h index cf51d971..e4f04ce0 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-03-05 10:38]" +#define COMPILE_DATE_STRING "[2004-03-09 02:02]" diff --git a/src/editor.c b/src/editor.c index 5a567832..b20ff454 100644 --- a/src/editor.c +++ b/src/editor.c @@ -511,31 +511,32 @@ #define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 7) #define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 8) #define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 9) -#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 10) -#define GADGET_ID_CUSTOM_EXPLODE_RESULT (GADGET_ID_CHECKBUTTON_FIRST + 11) -#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 12) -#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 13) -#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 14) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 15) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 16) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 17) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 18) -#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 19) -#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 20) -#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 21) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 22) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 23) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 24) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 25) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 26) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 27) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 10) +#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 11) +#define GADGET_ID_CUSTOM_EXPLODE_RESULT (GADGET_ID_CHECKBUTTON_FIRST + 12) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 13) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 14) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 15) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 16) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 17) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 18) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 22) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 23) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 24) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 25) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 26) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 27) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 32) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 33) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -703,30 +704,31 @@ #define ED_CHECKBUTTON_ID_USE_SPRING_BUG 5 #define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 6 #define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 7 -#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 8 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 9 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 10 -#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 11 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 12 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 13 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 14 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 15 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 16 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 17 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT 18 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 19 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 20 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 21 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 22 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 23 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 24 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 25 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 26 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 27 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 28 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 29 - -#define ED_NUM_CHECKBUTTONS 30 +#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 8 +#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 9 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 10 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 11 +#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 12 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 13 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 14 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 15 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 16 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 17 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 18 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT 19 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 20 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 21 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 22 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 23 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 24 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 25 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 26 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 27 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 28 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 29 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 30 + +#define ED_NUM_CHECKBUTTONS 31 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -1924,19 +1926,26 @@ static struct "use spring pushing bug", "use odd spring pushing behaviour" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), GADGET_ID_BLOCK_LAST_FIELD, GADGET_ID_NONE, &level.block_last_field, NULL, "block last field when moving", "player blocks last field when moving" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), GADGET_ID_SP_BLOCK_LAST_FIELD, GADGET_ID_NONE, &level.sp_block_last_field, NULL, "block last field when moving", "player blocks last field when moving" }, + { + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + GADGET_ID_CAN_FALL_INTO_ACID, GADGET_ID_NONE, + &level.player_can_fall_into_acid, + NULL, + "can fall into acid (with gravity)","player can fall into acid pool" + }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), GADGET_ID_CAN_MOVE_INTO_ACID, GADGET_ID_NONE, @@ -6880,9 +6889,12 @@ static void DrawPropertiesConfig() } if (ELEM_IS_PLAYER(properties_element)) + { + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID); MapCheckbuttonGadget(properties_element == EL_SP_MURPHY ? ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD : ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD); + } if (IS_GEM(properties_element)) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS); @@ -6891,6 +6903,7 @@ static void DrawPropertiesConfig() (!IS_CUSTOM_ELEMENT(properties_element) || edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2)) { + /* set position for special checkbutton for "can move into acid" */ checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].y = ED_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 6 : HAS_CONTENT(properties_element) ? 1 : 0); @@ -6952,8 +6965,6 @@ static void DrawPropertiesConfig() } else if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2) { - /* set position for special checkbutton for "can move into acid" */ - /* draw checkbutton gadgets */ for (i = ED_CHECKBUTTON_ID_CUSTOM2_FIRST; i <= ED_CHECKBUTTON_ID_CUSTOM2_LAST; i++) diff --git a/src/files.c b/src/files.c index bf3b77e7..c5d8eb30 100644 --- a/src/files.c +++ b/src/files.c @@ -29,7 +29,7 @@ #define CHUNK_SIZE_NONE -1 /* do not write chunk size */ #define FILE_VERS_CHUNK_SIZE 8 /* size of file version chunk */ #define LEVEL_HEADER_SIZE 80 /* size of level file header */ -#define LEVEL_HEADER_UNUSED 7 /* unused level header bytes */ +#define LEVEL_HEADER_UNUSED 6 /* unused level header bytes */ #define LEVEL_CHUNK_CNT2_SIZE 160 /* size of level CNT2 chunk */ #define LEVEL_CHUNK_CNT2_UNUSED 11 /* unused CNT2 chunk bytes */ #define LEVEL_CHUNK_CNT3_HEADER 16 /* size of level CNT3 header */ @@ -164,6 +164,8 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) level->can_move_into_acid_bits = ~0; /* everything can move into acid */ + level->player_can_fall_into_acid = TRUE; + level->use_step_counter = FALSE; level->use_custom_template = FALSE; @@ -687,6 +689,8 @@ static int LoadLevel_HEAD(FILE *file, int chunk_size, struct LevelInfo *level) level->use_step_counter = (getFile8Bit(file) == 1 ? TRUE : FALSE); + level->player_can_fall_into_acid = (getFile8Bit(file) == 1 ? TRUE : FALSE); + ReadUnusedBytesFromFile(file, LEVEL_HEADER_UNUSED); return chunk_size; @@ -2421,6 +2425,8 @@ static void SaveLevel_HEAD(FILE *file, struct LevelInfo *level) putFile8Bit(file, (level->use_step_counter ? 1 : 0)); + putFile8Bit(file, (level->player_can_fall_into_acid ? 1 : 0)); + WriteUnusedBytesToFile(file, LEVEL_HEADER_UNUSED); } diff --git a/src/game.c b/src/game.c index d5556234..6a797d86 100644 --- a/src/game.c +++ b/src/game.c @@ -2545,6 +2545,9 @@ void RelocatePlayer(int x, int y, int element_raw) boolean no_delay = (tape.index_search); int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay); int wait_delay_value = (no_delay ? 0 : frame_delay_value); +#if 1 + int old_jx, old_jy; +#endif if (player->GameOver) /* do not reanimate dead player */ return; @@ -2574,9 +2577,49 @@ void RelocatePlayer(int x, int y, int element_raw) player->is_moving = FALSE; } +#if 1 + old_jx = player->jx; + old_jy = player->jy; +#endif + Feld[x][y] = element; InitPlayerField(x, y, element, TRUE); +#if 0 + if (player == local_player) + { +#if 1 + + scroll_x += (local_player->jx - old_jx); + scroll_y += (local_player->jy - old_jy); + + /* don't scroll over playfield boundaries */ + if (scroll_x < SBX_Left || scroll_x > SBX_Right) + scroll_x = (scroll_x < SBX_Left ? SBX_Left : SBX_Right); + + /* don't scroll over playfield boundaries */ + if (scroll_y < SBY_Upper || scroll_y > SBY_Lower) + scroll_y = (scroll_y < SBY_Upper ? SBY_Upper : SBY_Lower); + +#else + scroll_x = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left : + local_player->jx > SBX_Right + MIDPOSX ? SBX_Right : + local_player->jx - MIDPOSX); + + scroll_y = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : + local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : + local_player->jy - MIDPOSY); +#endif + + RedrawPlayfield(TRUE, 0,0,0,0); +#if 0 + DrawAllPlayers(); + BackToFront(); +#endif + } + +#else + if (player == local_player) { int scroll_xx = -999, scroll_yy = -999; @@ -2616,6 +2659,7 @@ void RelocatePlayer(int x, int y, int element_raw) Delay(wait_delay_value); } } +#endif } void Explode(int ex, int ey, int phase, int mode) @@ -7201,7 +7245,8 @@ static byte PlayerActions(struct PlayerInfo *player, byte player_action) #if 0 /* !!! TEST !!! */ - CheckGravityMovement(player); + if (player->MovPos == 0) + CheckGravityMovement(player); #endif if (button1) snapped = SnapField(player, dx, dy); @@ -7428,7 +7473,13 @@ void GameActions() int actual_player_action = stored_player[i].effective_action; #if 1 - /* OLD: overwrite programmed action with tape action (BAD!!!) */ + /* !!! TEST !!! */ + if (stored_player[i].MovPos == 0) + CheckGravityMovement(&stored_player[i]); +#endif + +#if 1 + /* overwrite programmed action with tape action */ if (stored_player[i].programmed_action) actual_player_action = stored_player[i].programmed_action; #endif @@ -7448,11 +7499,17 @@ void GameActions() } #if 0 - /* NEW: overwrite tape action with programmed action */ + /* overwrite tape action with programmed action */ if (stored_player[i].programmed_action) actual_player_action = stored_player[i].programmed_action; #endif +#if 0 + if (i == 0) + printf("::: action: %d: %x [%d]\n", + stored_player[i].MovPos, actual_player_action, FrameCounter); +#endif + tape_action[i] = PlayerActions(&stored_player[i], actual_player_action); if (tape.recording && tape_action[i] && !tape.player_participates[i]) @@ -8103,13 +8160,13 @@ static void CheckGravityMovement(struct PlayerInfo *player) int dy = (move_dir & MV_UP ? -1 : move_dir & MV_DOWN ? +1 : 0); int new_jx = jx + dx, new_jy = jy + dy; boolean player_is_snapping = player->action & JOY_BUTTON_1; -#if 0 - /* !!! MAKE THIS CUSTOMIZABLE !!! */ - boolean field_under_player_is_free_or_acid = +#if 1 + boolean player_can_fall_down = (IN_LEV_FIELD(jx, jy + 1) && - (IS_FREE(jx, jy + 1) || Feld[jx][jy + 1] == EL_ACID)); + (IS_FREE(jx, jy + 1) || + (Feld[jx][jy + 1] == EL_ACID && level.player_can_fall_into_acid))); #else - boolean field_under_player_is_free_or_acid = + boolean player_can_fall_down = (IN_LEV_FIELD(jx, jy + 1) && (IS_FREE(jx, jy + 1))); #endif @@ -8132,13 +8189,13 @@ static void CheckGravityMovement(struct PlayerInfo *player) #if 0 printf("::: checking gravity NOW [%d, %d, %d] [%d] ...\n", - field_under_player_is_free_or_acid, + player_can_fall_down, player_is_standing_on_valid_field, player_is_moving_to_valid_field, (player_is_moving_to_valid_field ? Feld[new_jx][new_jy] : -1)); #endif - if (field_under_player_is_free_or_acid && + if (player_can_fall_down && !player_is_standing_on_valid_field && !player_is_moving_to_valid_field) { @@ -8627,6 +8684,47 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) player->LevelSolved = player->GameOver = TRUE; } +#if 0 + /* !!! ENABLE THIS FOR NEW VERSIONS !!! */ + { + static int trigger_sides[4][2] = + { + /* enter side leave side */ + { CH_SIDE_RIGHT, CH_SIDE_LEFT }, /* moving left */ + { CH_SIDE_LEFT, CH_SIDE_RIGHT }, /* moving right */ + { CH_SIDE_BOTTOM, CH_SIDE_TOP }, /* moving up */ + { CH_SIDE_TOP, CH_SIDE_BOTTOM } /* moving down */ + }; + int move_direction = player->MovDir; + int enter_side = trigger_sides[MV_DIR_BIT(move_direction)][0]; + int leave_side = trigger_sides[MV_DIR_BIT(move_direction)][1]; + int old_jx = last_jx; + int old_jy = last_jy; + +#if 1 + if (IS_CUSTOM_ELEMENT(Feld[old_jx][old_jy])) + { + CheckTriggeredElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy], + CE_OTHER_GETS_LEFT, + player->index_bit, leave_side); + CheckElementChangePlayer(old_jx, old_jy, Feld[old_jx][old_jy], + CE_LEFT_BY_PLAYER, + player->index_bit, leave_side); + } + + if (IS_CUSTOM_ELEMENT(Feld[jx][jy])) + { + CheckTriggeredElementChangePlayer(jx, jy, Feld[jx][jy], + CE_OTHER_GETS_ENTERED, + player->index_bit, enter_side); + CheckElementChangePlayer(jx, jy, Feld[jx][jy], CE_ENTERED_BY_PLAYER, + player->index_bit, enter_side); + } +#endif + + } +#endif + if (game.engine_version >= VERSION_IDENT(3,0,7,0)) { TestIfHeroTouchesBadThing(jx, jy); @@ -10137,8 +10235,13 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) dy == -1 ? MV_UP : dy == +1 ? MV_DOWN : MV_NO_MOVING); +#if 0 + if (player->MovPos) + return FALSE; +#else if (player->MovPos && game.engine_version >= VERSION_IDENT(2,2,0,0)) return FALSE; +#endif if (!player->active || !IN_LEV_FIELD(x, y)) return FALSE; @@ -10585,7 +10688,25 @@ void RequestQuitGame(boolean ask_if_really_quit) } else { + +#if 1 + if (tape.playing && tape.index_search) + { + SetDrawDeactivationMask(REDRAW_NONE); + audio.sound_deactivated = FALSE; + } +#endif + OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK); + +#if 1 + if (tape.playing && tape.index_search) + { + SetDrawDeactivationMask(REDRAW_FIELD); + audio.sound_deactivated = TRUE; + } +#endif + } } diff --git a/src/libgame/misc.c b/src/libgame/misc.c index cb0f6525..a7eeb72f 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1232,7 +1232,7 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode) char c = name_ptr[6]; if (c >= '0' && c <= '9') - key = KSYM_0 + (Key)(c - '0'); + key = KSYM_KP_0 + (Key)(c - '0'); } else if (strncmp(name_ptr, "XK_F", 4) == 0 && strlen(name_ptr) <= 6) { diff --git a/src/main.h b/src/main.h index b483378e..e55db3cb 100644 --- a/src/main.h +++ b/src/main.h @@ -1425,6 +1425,8 @@ struct LevelInfo int can_move_into_acid_bits; /* bits indicate property for element groups */ + boolean player_can_fall_into_acid; + boolean double_speed; boolean initial_gravity; boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */ diff --git a/src/tape.c b/src/tape.c index f05a3b45..36748a7e 100644 --- a/src/tape.c +++ b/src/tape.c @@ -420,8 +420,13 @@ void TapeRecordAction(byte action[MAX_PLAYERS]) { int i; +#if 1 + if (!tape.recording) /* record action even when tape is paused! */ + return; +#else if (!tape.recording || tape.pausing) return; +#endif if (tape.counter >= MAX_TAPELEN - 1) { @@ -636,8 +641,13 @@ static void TapeStopIndexSearch() SetDrawDeactivationMask(REDRAW_NONE); audio.sound_deactivated = FALSE; - RedrawPlayfield(TRUE, 0,0,0,0); - DrawGameDoorValues(); +#if 1 + if (game_status == GAME_MODE_PLAYING) +#endif + { + RedrawPlayfield(TRUE, 0,0,0,0); + DrawGameDoorValues(); + } } static void TapeSingleStep() diff --git a/src/tools.c b/src/tools.c index 8f3798a4..2f6bd8d8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2050,6 +2050,15 @@ boolean Request(char *text, unsigned int req_state) } } +#if 1 + /* disable deactivated drawing when quick-loading level tape recording */ + if (tape.playing && tape.index_search) + { + SetDrawDeactivationMask(REDRAW_NONE); + audio.sound_deactivated = FALSE; + } +#endif + #if 1 SetMouseCursor(CURSOR_DEFAULT); #endif @@ -2313,6 +2322,15 @@ boolean Request(char *text, unsigned int req_state) SendToServer_ContinuePlaying(); #endif +#if 1 + /* restore deactivated drawing when quick-loading level tape recording */ + if (tape.playing && tape.index_search) + { + SetDrawDeactivationMask(REDRAW_FIELD); + audio.sound_deactivated = TRUE; + } +#endif + return result; }