X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame_em%2Flogic.c;h=8bd29b3c4f9753145da0bf491c7721c1716298c5;hb=dd04ac635e8722c7f5de3b34fec011925b33808f;hp=bcaf88c82f72b3bfcc7ea52ca4e3110dfddd459a;hpb=8d8ab8ed86cab6b938ce26f97b02ffe2cf948e4c;p=rocksndiamonds.git diff --git a/src/game_em/logic.c b/src/game_em/logic.c index bcaf88c8..8bd29b3c 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -1228,7 +1228,7 @@ static void check_player(struct PLAYER *ply) static void set_nearest_player_xy(int x, int y, int *dx, int *dy) { - int distance, distance_shortest = EM_MAX_CAVE_WIDTH + EM_MAX_CAVE_HEIGHT; + int distance, distance_shortest = CAVE_WIDTH + CAVE_HEIGHT; int i; /* default values if no players are alive anymore */ @@ -6273,8 +6273,8 @@ void logic_2(void) seed = RandomEM; score = 0; - for (y = 1; y < HEIGHT - 1; y++) - for (x = 0; x < WIDTH; x++) + for (y = 1; y < CAVE_BUFFER_HEIGHT - 1; y++) + for (x = 0; x < CAVE_BUFFER_WIDTH; x++) handle_tile(x, y); if (ply[0].alive || ply[1].alive || ply[2].alive || ply[3].alive) @@ -6334,8 +6334,8 @@ void logic_3(void) for (count = lev.amoeba_time; count--;) { - x = (random >> 10) % (WIDTH - 2); - y = (random >> 20) % (HEIGHT - 2); + x = CAVE_BUFFER_XOFFSET - 1 + (random >> 10) % CAVE_WIDTH; + y = CAVE_BUFFER_YOFFSET - 1 + (random >> 20) % CAVE_HEIGHT; Lamoeba(x, y); @@ -6346,13 +6346,13 @@ void logic_3(void) /* handle explosions */ - for (y = 1; y < HEIGHT - 1; y++) - for (x = 1; x < WIDTH - 1; x++) + for (y = 1; y < CAVE_BUFFER_HEIGHT - 1; y++) + for (x = 1; x < CAVE_BUFFER_WIDTH - 1; x++) Lexplode(x, y); /* triple buffering */ - for (y = 0; y < HEIGHT; y++) - for (x = 0; x < WIDTH; x++) + for (y = 0; y < CAVE_BUFFER_HEIGHT; y++) + for (x = 0; x < CAVE_BUFFER_WIDTH; x++) next[x][y] = cave[x][y]; }