X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=src%2Fserver%2Fio.c;h=17110d324c804e047bcd3a212fccd4165982ee35;hb=d847c33eb340cf5202eaf10a8d05ba0ec63c486c;hp=62284153ace342dd035d72b0c258df60df3e5e50;hpb=1cb57a35a3b3cc4ec8870531ca254a655c0bdda2;p=plomrogue diff --git a/src/server/io.c b/src/server/io.c index 6228415..17110d3 100644 --- a/src/server/io.c +++ b/src/server/io.c @@ -19,7 +19,6 @@ #include "cleanup.h" /* set_cleanup_flag() */ #include "field_of_view.h" /* VISIBLE */ #include "hardcoded_strings.h" /* s */ -#include "map.h" /* yx_to_map_pos() */ #include "things.h" /* Thing, ThingType, ThingAction, get_thing_type(), * get_player() */ @@ -277,13 +276,14 @@ static char * build_visible_map(struct Thing * player) { for (t = world.things; t != 0; t = t->next) { - if ( player->fov_map[yx_to_map_pos(&t->pos)] & VISIBLE + if ( ( player->fov_map[t->pos.y * world.map.length +t->pos.x] + & VISIBLE) && ( (0 == i && 0 == t->lifepoints) || (1 == i && 0 < t->lifepoints))) { tt = get_thing_type(t->type); c = tt->char_on_map; - visible_map[yx_to_map_pos(&t->pos)] = c; + visible_map[t->pos.y * world.map.length + t->pos.x] = c; } } }