unify moverock() to "early return" style

... to prepare further refactorings.
This commit is contained in:
SHIRAKATA Kentaro
2024-09-03 23:46:21 -07:00
committed by PatR
parent 9a09bcdfc9
commit 7bb1d4a827
+4 -3
View File
@@ -546,16 +546,17 @@ moverock(void)
Sokoban rules because on next step you could go Sokoban rules because on next step you could go
past it without pushing it to plug a pit or hole */ past it without pushing it to plug a pit or hole */
sokoban_guilt(); sokoban_guilt();
break;
} }
break; moverock_done(sx, sy);
return 0;
} }
if (could_move_onto_boulder(sx, sy)) { if (could_move_onto_boulder(sx, sy)) {
pline( pline(
"However, you can squeeze yourself into a small opening."); "However, you can squeeze yourself into a small opening.");
sokoban_guilt(); sokoban_guilt();
break; moverock_done(sx, sy);
return 0;
} else { } else {
moverock_done(sx, sy); moverock_done(sx, sy);
return -1; return -1;