X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Flogic.c;h=a1afd71355f05055cbc43c4401ffa2a6603ff18c;hb=60e76fc5451a6caed053db7c94dce85daf845cb6;hp=d126415b774a3e8357a72a3189386f613a6b5cb7;hpb=4a35c39bbc9ffdcbf15953cb699fc8147ccce25d;p=rocksndiamonds.git diff --git a/src/game_em/logic.c b/src/game_em/logic.c index d126415b..a1afd713 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -6228,6 +6228,16 @@ void logic_1(void) for (i = 0; i < MAX_PLAYERS; i++) { + /* check for wrap-around movement */ + if (ply[i].x < lev.left || + ply[i].x > lev.right - 1) + { + ply[i].x = (ply[i].x < lev.left ? lev.right - 1 : lev.left); + + game.centered_player_nr_next = i; + game.set_centered_player = TRUE; + } + ply[i].oldx = ply[i].x; ply[i].oldy = ply[i].y; ply[i].anim = PLY_still; @@ -6334,8 +6344,8 @@ void logic_3(void) for (count = lev.amoeba_time; count--;) { - x = lev.left - 1 + (random >> 10) % CAVE_WIDTH; - y = lev.top - 1 + (random >> 20) % CAVE_HEIGHT; + x = lev.left - 1 + (random >> 10) % (CAVE_WIDTH + 2); + y = lev.top - 1 + (random >> 20) % (CAVE_HEIGHT + 2); if (x >= lev.left && x < lev.right && y >= lev.top && y < lev.bottom)