X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fserver%2Fmap.c;h=29beb1a03d5d0a6ebf1113d6ead1cd34763f2573;hb=f9c94db47aa883149aa762fa128ac1ff1b3f92e1;hp=2969b6dd4f9d551c40ebd3e7e7879989f0fea635;hpb=e03020342a74aef143b1ec38c18966dac64181b5;p=plomrogue
diff --git a/src/server/map.c b/src/server/map.c
index 2969b6d..29beb1a 100644
--- a/src/server/map.c
+++ b/src/server/map.c
@@ -1,9 +1,9 @@
/* src/server/map.c */
#include "map.h"
-#include /* uint8_t, uint16_t, uint32_t */
+#include /* uint8_t, uint16_t */
#include "../common/try_malloc.h" /* try_malloc() */
-#include "../common/yx_uint16.h" /* struct yx_uint16 */
+#include "../common/yx_uint8.h" /* struct yx_uint8 */
#include "rrand.h" /* rrand() */
#include "world.h" /* global world */
@@ -12,9 +12,9 @@
extern void init_map()
{
char * f_name = "init_map()";
- uint32_t size = world.map.size.x * world.map.size.y;
+ uint16_t size = world.map.size.x * world.map.size.y;
world.map.cells = try_malloc(size, f_name);
- uint16_t y, x;
+ uint8_t y, x;
for (y = 0; y < world.map.size.y; y++)
{
for (x = 0;
@@ -22,7 +22,7 @@ extern void init_map()
world.map.cells[(y * world.map.size.x) + x] = '~', x++);
}
world.map.cells[size / 2 + (world.map.size.x / 2)] = '.';
- uint32_t curpos;
+ uint16_t curpos;
while (1)
{
y = rrand() % world.map.size.y;
@@ -51,7 +51,7 @@ extern void init_map()
-extern uint8_t is_passable(struct yx_uint16 pos)
+extern uint8_t is_passable(struct yx_uint8 pos)
{
uint8_t passable = 0;
if ( 0 <= pos.x && pos.x < world.map.size.x