Merge pull request #1366 from tonymorony/jl777

fixing block fit on blocks swap from both ends now and not making unnecessary moves
This commit is contained in:
jl777
2019-03-29 06:56:34 -11:00
committed by GitHub

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);