From d666ded12550cfc6fb50dd47e97b664ae82647a1 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 6 Feb 2014 00:12:57 +0100 Subject: [PATCH] Fixed some more pitfalls that hurt working with game maps of maximum size. --- src/client/draw_wins.c | 2 +- src/client/io.c | 2 +- src/server/io.c | 2 +- src/server/map.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/draw_wins.c b/src/client/draw_wins.c index f10e9cb..7cdb0b5 100644 --- a/src/client/draw_wins.c +++ b/src/client/draw_wins.c @@ -323,7 +323,7 @@ extern void draw_win_map(struct Win * win) { try_resize_winmap(win, world.map.size.y, world.map.size.x); uint16_t z = 0; - uint8_t x, y; + uint16_t x, y; for (y = 0; y < world.map.size.y; y++) { for (x = 0; x < world.map.size.x; x++) diff --git a/src/client/io.c b/src/client/io.c index 43a695a..a4dc7f3 100644 --- a/src/client/io.c +++ b/src/client/io.c @@ -110,7 +110,7 @@ static void read_map_cells(FILE * file) char * f_name = "read_map_cells()"; free(world.map.cells); world.map.cells = try_malloc(world.map.size.y * world.map.size.x, f_name); - uint8_t y, x; + uint16_t y, x; for (y = 0; y < world.map.size.y; y++) { for (x = 0; x < world.map.size.x; x++) diff --git a/src/server/io.c b/src/server/io.c index 2507d3b..1de0bd0 100644 --- a/src/server/io.c +++ b/src/server/io.c @@ -203,7 +203,7 @@ static void write_map(FILE * file) } } } - uint8_t x, y; + uint16_t x, y; for (y = 0; y < world.map.size.y; y++) { for (x = 0; x < world.map.size.x; x++) diff --git a/src/server/map.c b/src/server/map.c index 9b0f294..8bae81a 100644 --- a/src/server/map.c +++ b/src/server/map.c @@ -14,7 +14,7 @@ extern void init_map() char * f_name = "init_map()"; uint32_t size = world.map.size.x * world.map.size.y; world.map.cells = try_malloc(size, f_name); - uint8_t y, x; + uint16_t y, x; for (y = 0; y < world.map.size.y; y++) { for (x = 0; -- 2.30.2