X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/static/git-logo.png?a=blobdiff_plain;f=src%2Fserver%2Ffield_of_view.c;h=d6b3a8d1278124c6de9694823a416cb1c24b2663;hb=6a9f579e2c47c5d60b37d343465e08faf26a9255;hp=7ab567833a1bd67eb3087c67e80e9fc92eb28c70;hpb=8d4de89107cf8e29c45c6375f4299b11d1d01d9a;p=plomrogue diff --git a/src/server/field_of_view.c b/src/server/field_of_view.c index 7ab5678..d6b3a8d 100644 --- a/src/server/field_of_view.c +++ b/src/server/field_of_view.c @@ -13,7 +13,7 @@ #include "../common/rexit.h" /* exit_trouble() */ #include "../common/try_malloc.h" /* try_malloc() */ #include "../common/yx_uint8.h" /* yx_uint8 */ -#include "map.h" /* mv_yx_in_dir_legal() */ +#include "map.h" /* mv_yx_in_dir_legal(), init_empty_map() */ #include "things.h" /* Thing, ThingInMemory, add_thing_to_memory_map() */ #include "world.h" /* world */ @@ -266,8 +266,7 @@ extern void update_map_memory(struct Thing * t_eye) { if (!t_eye->mem_map) { - t_eye->mem_map = try_malloc(world.map.length*world.map.length,__func__); - memset(t_eye->mem_map, ' ', world.map.length * world.map.length); + init_empty_map(&(t_eye->mem_map)); } uint32_t i; for (i = 0; i < (uint32_t) (world.map.length * world.map.length); i++)