X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fserver%2Fthing_actions.c;h=40a44ba17ce71dd4ed51a8ae29137b9618edce95;hb=edebb2bf9aa780ee2f7006c1d2be9168564d34df;hp=bcf9e455f4d382d538633f75681f77b6d76d7b3d;hpb=1cb57a35a3b3cc4ec8870531ca254a655c0bdda2;p=plomrogue diff --git a/src/server/thing_actions.c b/src/server/thing_actions.c index bcf9e45..40a44ba 100644 --- a/src/server/thing_actions.c +++ b/src/server/thing_actions.c @@ -142,8 +142,16 @@ static void actor_hits_actor(struct Thing * hitter, struct Thing * hitted) if (player == hitted) { update_log(" You die."); + memset(hitted->fov_map, ' ', world.map.length * world.map.length); return; } + else + { + free(hitted->fov_map); + hitted->fov_map = NULL; + free(hitted->mem_map); + hitted->mem_map = NULL; + } update_log(" It dies."); } } @@ -266,8 +274,7 @@ extern void actor_move(struct Thing * t) if (passable) { set_thing_position(t, target); - free(t->fov_map); - t->fov_map = build_fov_map(t); + build_fov_map(t); } if (t == get_player()) {