+ uint32_t map_size = world.map.length * world.map.length;
+ char * mem_map = try_malloc(map_size, __func__);
+ memcpy(mem_map, player->mem_map, map_size);
+ uint8_t i;
+ struct ThingInMemory * tm;
+ for (i = 0; i < 2; i++)
+ {
+ for (tm = player->t_mem; tm; tm = tm->next)
+ {
+ if (' ' != player->mem_map[tm->pos.y*world.map.length+tm->pos.x])
+ {
+ struct ThingType * tt = get_thing_type(tm->type);
+ if ( (0 == i && !tt->consumable)
+ || (1 == i && tt->consumable))
+ {
+ char c = tt->char_on_map;
+ mem_map[tm->pos.y * world.map.length + tm->pos.x] = c;
+ }
+ }
+ }
+ }
+ for (y = 0; y < world.map.length; y++)
+ {
+ for (x = 0; x < world.map.length; x++)
+ {
+ try_fputc(mem_map[y * world.map.length + x], file, __func__);
+ }
+ try_fputc('\n', file, __func__);
+ }
+ free(mem_map);