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;
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)