From 29b190e0f57b855d21048293ca19d048a4d4657b Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 26 Jun 2025 11:09:01 +0200 Subject: [PATCH] simplify movement logic a bit further --- src/game/tetromino/placing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/tetromino/placing.c b/src/game/tetromino/placing.c index 07f6b53..45553f9 100644 --- a/src/game/tetromino/placing.c +++ b/src/game/tetromino/placing.c @@ -116,10 +116,10 @@ void place_update(struct gamedata* gdat, int movdat) { } // update X axis - tmp = !!(movdat & MOVL) * -1 + !!(movdat & MOVR); + tmp = !!(movdat & MOVL) - !!(movdat & MOVR); gdat->pdat.sel[0] += (tmp && shape_intersects(gdat->rows, id, gdat->pdat.sel + (i8vec2){tmp, 0})) * tmp; // update roll - tmp = id - (((!!(movdat & MOVRL) * -8 + !!(movdat & MOVRR) * 8) + id) & 31); + tmp = id - (((!!(movdat & MOVRL) - !!(movdat & MOVRR)) * 8 + id) & 31); gdat->pdat.nxt[idx] += (tmp && shape_intersects(gdat->rows, tmp, gdat->pdat.sel)) * tmp; }