From 7bb1d4a8270979cfc60b1cbf68d0ba128f25afeb Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Wed, 21 Aug 2024 23:20:55 +0900 Subject: [PATCH] unify moverock() to "early return" style ... to prepare further refactorings. --- src/hack.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hack.c b/src/hack.c index 53da33e80..be77ff992 100644 --- a/src/hack.c +++ b/src/hack.c @@ -546,16 +546,17 @@ moverock(void) Sokoban rules because on next step you could go past it without pushing it to plug a pit or hole */ sokoban_guilt(); - break; } - break; + moverock_done(sx, sy); + return 0; } if (could_move_onto_boulder(sx, sy)) { pline( "However, you can squeeze yourself into a small opening."); sokoban_guilt(); - break; + moverock_done(sx, sy); + return 0; } else { moverock_done(sx, sy); return -1;