Skip to content

Commit

Permalink
Made the exit door fix configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
NagyD committed Jun 9, 2018
1 parent bc4a78e commit 5afae33
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions SDLPoP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ fix_hidden_floors_during_flashing = true
; By jumping towards one of the bottom corners of the room and grabbing a ledge, you can teleport to the room above.
fix_hang_on_teleport = true

; You can enter closed exit doors after you met Jaffar or the shadow, or after you opened one of multiple exits.
fix_exit_door = true


[CustomGameplay]
; Turn on customization options.
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,4 @@ FIXED: Improved map-making on levels with broken room links: If a room is mapped
DONE: Load custom options from DOS PRINCE.EXE files.
DONE: Added a hotkey to display SDL versions. (Ctrl-C)
DONE: Save screenshots and maps into a separate folder and add numbers to the filenames.
FIXED: Made the exit door fix configurable.
5 changes: 5 additions & 0 deletions src/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ enum setting_ids {
SETTING_FIX_MOVE_AFTER_SHEATHE,
SETTING_FIX_HIDDEN_FLOORS_DURING_FLASHING,
SETTING_FIX_HANG_ON_TELEPORT,
SETTING_FIX_EXIT_DOOR,
SETTING_USE_CUSTOM_OPTIONS,
SETTING_START_MINUTES_LEFT,
SETTING_START_TICKS_LEFT,
Expand Down Expand Up @@ -523,6 +524,10 @@ setting_type gameplay_settings[] = {
.linked = &fixes_saved.fix_hang_on_teleport, .required = &use_fixes_and_enhancements,
.text = "Fix hang on teleport bug",
.explanation = "By jumping towards one of the bottom corners of the room and grabbing a ledge, you can teleport to the room above."},
{.id = SETTING_FIX_EXIT_DOOR, .style = SETTING_STYLE_TOGGLE,
.linked = &fixes_saved.fix_exit_door, .required = &use_fixes_and_enhancements,
.text = "Fix exit doors",
.explanation = "You can enter closed exit doors after you met Jaffar or the shadow, or after you opened one of multiple exits."},
};

NAMES_LIST(tile_type_setting_names, {
Expand Down
1 change: 1 addition & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ static int global_ini_callback(const char *section, const char *name, const char
process_boolean("fix_move_after_sheathe", &fixes_saved.fix_move_after_sheathe);
process_boolean("fix_hidden_floors_during_flashing", &fixes_saved.fix_hidden_floors_during_flashing);
process_boolean("fix_hang_on_teleport", &fixes_saved.fix_hang_on_teleport);
process_boolean("fix_exit_door", &fixes_saved.fix_exit_door);
}

if (check_ini_section("CustomGameplay")) {
Expand Down
1 change: 1 addition & 0 deletions src/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ void options_process_fixes(SDL_RWops* rw, rw_process_func_type process_func) {
process(fixes_options_replay.fix_move_after_sheathe);
process(fixes_options_replay.fix_hidden_floors_during_flashing);
process(fixes_options_replay.fix_hang_on_teleport);
process(fixes_options_replay.fix_exit_door);
}

void options_process_custom_general(SDL_RWops* rw, rw_process_func_type process_func) {
Expand Down
6 changes: 5 additions & 1 deletion src/seg005.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ void __pascal far up_pressed() {
else if (get_tile_infrontof_char() == tiles_16_level_door_left) leveldoor_tilepos = curr_tilepos;
if ((leveldoor_tilepos != -1) &&
level.start_room != drawn_room &&
curr_room_modif[leveldoor_tilepos] >= 42 // this door must be fully open
(
fixes->fix_exit_door
? curr_room_modif[leveldoor_tilepos] >= 42 // this door must be fully open
: leveldoor_open
)
){
go_up_leveldoor();
} else {
Expand Down
1 change: 1 addition & 0 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ typedef struct fixes_options_type {
byte fix_move_after_sheathe;
byte fix_hidden_floors_during_flashing;
byte fix_hang_on_teleport;
byte fix_exit_door;
} fixes_options_type;

typedef struct custom_options_type {
Expand Down

0 comments on commit 5afae33

Please sign in to comment.