From 0bc5f963f66050ed0018bf1228f5b17c686457c0 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Fri, 6 Feb 2015 01:00:56 +0100 Subject: [PATCH] Server: Fix segfault when parsing THINGS_HERE on player sans .fov_map. --- src/server/run.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/run.c b/src/server/run.c index 38dc5a0..c160e9f 100644 --- a/src/server/run.c +++ b/src/server/run.c @@ -222,7 +222,8 @@ static uint8_t parse_command_meta(char * tok0) } send_to_outfile("THINGS_HERE START\n", 1); struct Thing * player = get_player(); - if ('v' == player->fov_map[atoi(tok1)*world.map.length+atoi(tok2)]) + if (player->fov_map && + 'v' == player->fov_map[atoi(tok1)*world.map.length+atoi(tok2)]) { struct Thing * t; for (t = world.things; t; t = t->next) -- 2.30.2