home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some code-internal restructuring following the assumption that game map height /
[plomrogue]
/
src
/
server
/
io.c
diff --git
a/src/server/io.c
b/src/server/io.c
index 800f539aea747e53413f13d09fdc1cee7c823015..a516d81b018b121a90c3fb614415b029634c81d1 100644
(file)
--- a/
src/server/io.c
+++ b/
src/server/io.c
@@
-66,8
+66,8
@@
static char * get_message_from_queue()
world.queue_size = world.queue_size - cutout_len;
if (0 == world.queue_size)
{
world.queue_size = world.queue_size - cutout_len;
if (0 == world.queue_size)
{
- free(world.queue);
- world.queue = NULL;
+ free(world.queue);
/* NULL so read_fifo_into_queue() may free() this */
+ world.queue = NULL;
/* every time, even when it's un-allocated first. */
}
else
{
}
else
{
@@
-183,7
+183,7
@@
static void write_inventory(struct MapObj * player, FILE * file)
static void write_map(FILE * file)
{
char * f_name = "write_map()";
static void write_map(FILE * file)
{
char * f_name = "write_map()";
- uint
32
_t map_size = world.map.size.y * world.map.size.x;
+ uint
16
_t map_size = world.map.size.y * world.map.size.x;
char visible_map[map_size];
memcpy(visible_map, world.map.cells, map_size);
struct MapObj * o;
char visible_map[map_size];
memcpy(visible_map, world.map.cells, map_size);
struct MapObj * o;
@@
-203,7
+203,7
@@
static void write_map(FILE * file)
}
}
}
}
}
}
- uint
16
_t x, y;
+ uint
8
_t x, y;
for (y = 0; y < world.map.size.y; y++)
{
for (x = 0; x < world.map.size.x; x++)
for (y = 0; y < world.map.size.y; y++)
{
for (x = 0; x < world.map.size.x; x++)