Skip to content

Commit

Permalink
Fix kid being able to enter closed level doors when there are multipl…
Browse files Browse the repository at this point in the history
…e exits

Instead of checking the global "leveldoor_open" variable when attempting to enter, check the "open" status of that specific level door.
  • Loading branch information
Falcury committed Jun 17, 2015
1 parent d66b72c commit eec4e90
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions seg005.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,13 @@ void __pascal far control_standing() {

// seg005:0482
void __pascal far up_pressed() {
if ((get_tile_at_char() == tiles_16_level_door_left ||
get_tile_behind_char() == tiles_16_level_door_left ||
get_tile_infrontof_char() == tiles_16_level_door_left) &&
int leveldoor_tilepos = -1;
if (get_tile_at_char() == tiles_16_level_door_left) leveldoor_tilepos = curr_tilepos;
else if (get_tile_behind_char() == tiles_16_level_door_left) leveldoor_tilepos = curr_tilepos;
else if (get_tile_infrontof_char() == tiles_16_level_door_left) leveldoor_tilepos = curr_tilepos;
if ((leveldoor_tilepos != -1) &&
level.start_room != drawn_room &&
leveldoor_open
curr_room_modif[leveldoor_tilepos] >= 43 // this door must be fully open
){
go_up_leveldoor();
} else {
Expand Down

0 comments on commit eec4e90

Please sign in to comment.