home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Maps are always squares, therefore define only their edge lengths.
[plomrogue]
/
src
/
server
/
io.c
diff --git
a/src/server/io.c
b/src/server/io.c
index 964e06a69f53a6b389f5f038997cc96f6c9f4b6a..488f92bd34ac8a2923b1a500f2c3d8f1c9d94a98 100644
(file)
--- a/
src/server/io.c
+++ b/
src/server/io.c
@@
-144,8
+144,7
@@
static void update_worldstate_file()
write_inventory(player, file);
write_value_as_line(player->pos.y, file);
write_value_as_line(player->pos.x, file);
write_inventory(player, file);
write_value_as_line(player->pos.y, file);
write_value_as_line(player->pos.x, file);
- write_value_as_line(world.map.size.y, file);
- write_value_as_line(world.map.size.x, file);
+ write_value_as_line(world.map.length, file);
write_map(player, file);
if (world.log)
{
write_map(player, file);
if (world.log)
{
@@
-199,7
+198,7
@@
static void write_inventory(struct MapObj * player, FILE * file)
static char * build_visible_map(struct MapObj * player)
{
char * f_name = "build_visible_map()";
static char * build_visible_map(struct MapObj * player)
{
char * f_name = "build_visible_map()";
- uint32_t map_size = world.map.
size.y * world.map.size.x
;
+ uint32_t map_size = world.map.
length * world.map.length
;
char * visible_map = try_malloc(map_size, f_name);
memset(visible_map, ' ', map_size);
uint16_t pos_i;
char * visible_map = try_malloc(map_size, f_name);
memset(visible_map, ' ', map_size);
uint16_t pos_i;
@@
-238,11
+237,11
@@
static void write_map(struct MapObj * player, FILE * file)
char * f_name = "write_map()";
char * visible_map = build_visible_map(player);
uint16_t x, y;
char * f_name = "write_map()";
char * visible_map = build_visible_map(player);
uint16_t x, y;
- for (y = 0; y < world.map.
size.y
; y++)
+ for (y = 0; y < world.map.
length
; y++)
{
{
- for (x = 0; x < world.map.
size.x
; x++)
+ for (x = 0; x < world.map.
length
; x++)
{
{
- try_fputc(visible_map[(y * world.map.
size.x
) + x], file, f_name);
+ try_fputc(visible_map[(y * world.map.
length
) + x], file, f_name);
}
try_fputc('\n', file, f_name);
}
}
try_fputc('\n', file, f_name);
}