X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Flogic.c;h=61f3237c98727d3faf59b09a032954befe854406;hb=03a494c7a4afcd22849d3c0f42193ded57fdc700;hp=bfb387f468727b5dce51e57b2e766b8de5b69593;hpb=9e073e68375e021ce34c7b7ccef33ee769dcaf03;p=rocksndiamonds.git diff --git a/src/game_em/logic.c b/src/game_em/logic.c index bfb387f4..61f3237c 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -293,7 +293,7 @@ static boolean player_killed(struct PLAYER *ply) if (!ply->alive) return FALSE; - if (lev.killed_out_of_time && setup.time_limit) + if (lev.killed_out_of_time && game.time_limit) return TRUE; switch (cave[x][y-1]) @@ -7695,10 +7695,12 @@ void logic_move(void) 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); + int direction = (ply[i].x < lev.left ? -1 : 1); + + ply[i].x += -direction * lev.width; if (!lev.infinite_true) - ply[i].y += (ply[i].x == lev.left ? 1 : -1); + ply[i].y += direction; game.centered_player_nr_next = i; game.set_centered_player = TRUE; @@ -7766,6 +7768,18 @@ static void logic_players(void) next[ply[i].x][ply[i].y] = add_player[element]; } } + + /* check for wheel at wrap-around position */ + if (lev.wheel_x < lev.left || + lev.wheel_x > lev.right - 1) + { + int direction = (lev.wheel_x < lev.left ? -1 : 1); + + lev.wheel_x += -direction * lev.width; + + if (!lev.infinite_true) + lev.wheel_y += direction; + } } static void logic_objects(void)