Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

Commit

Permalink
Fix hard drop when out of field boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Oxore committed Jul 9, 2018
1 parent a3eaa5d commit 7d6b30b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DEPENDS:=$(OBJECTS:.o=.d)
INCLUDE+=include
INCLUDE:=$(INCLUDE:%=-I%)

COMMON+=-fsanitize=address
#COMMON+=-fsanitize=address

CFLAGS+=$(COMMON)
CFLAGS+=$(INCLUDE)
Expand Down
5 changes: 4 additions & 1 deletion src/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ static void signal_up()
static void signal_harddrop()
{
while (field_move_shape_down(&fld, 1));
transition_put_shape();
if (field_shape_out_of_bounds(&fld, &fld.shape[1]))
transition_game_over();
else
transition_put_shape();
sfClock_restart(game.gameTick);
sfClock_restart(game.putTick);
}
Expand Down

0 comments on commit 7d6b30b

Please sign in to comment.