This commit is contained in:
2026-07-09 00:18:40 -05:00
parent e545395ac6
commit 386967e936
3 changed files with 27 additions and 32 deletions
+5 -4
View File
@@ -485,10 +485,11 @@ impl GameState {
// A solid object in the way is bumped by the player — possibly through a
// chain of crates the player is shoving (see `bump_target`) — but a grab
// thing fires grab() instead of bump(), so don't also bump it.
bumped = grabbed
.is_none()
.then(|| board.bump_target(nx, ny, dir))
.flatten();
bumped = if grabbed.is_none() {
board.bump_target(nx, ny, dir)
} else {
None
};
if grabbed.is_some() || board.is_passable(nx, ny) || board.can_push(nx, ny, dir) {
// Don't push a grab thing aside — walk onto it. Otherwise shove any
// pushable chain out of the way (no-op when there's nothing to push).