fixing fit from both ends

This commit is contained in:
Anton Lysakov
2019-03-30 00:15:48 +07:00
parent 7af8e1eda5
commit c09c253b49

View File

@@ -296,7 +296,14 @@ static void tg_hold(struct games_state *rs,tetris_game *obj)
obj->stored.ori = ori;
while (!tg_fits(obj, obj->falling)) {
obj->falling.loc.row--;
if (tg_fits(obj, obj->falling)) {
break;
}
obj->falling.loc.col--;
if (tg_fits(obj, obj->falling)) {
break;
}
obj->falling.loc.col += 2;
}
}
tg_put(obj, obj->falling);