+extern void update_map_memory(struct Thing * t_eye, uint8_t age_map)
+{
+ if (!t_eye->mem_map)
+ {
+ init_empty_map(&(t_eye->mem_map));
+ }
+ if (!t_eye->mem_depth_map)
+ {
+ init_empty_map(&(t_eye->mem_depth_map));
+ }
+ uint32_t i;
+ for (i = 0; i < (uint32_t) (world.map.length * world.map.length); i++)
+ {
+ if ('v' == t_eye->fov_map[i])
+ {
+ t_eye->mem_depth_map[i] = '0';
+ if (' ' == t_eye->mem_map[i])
+ {
+ t_eye->mem_map[i] = world.map.cells[i];
+ }
+ continue;
+ }
+ if (age_map &&
+ '0' <= t_eye->mem_depth_map[i] && '9' > t_eye->mem_depth_map[i]
+ && !(rrand() % (uint16_t) pow(2, t_eye->mem_depth_map[i] - 48)))
+ {
+ t_eye->mem_depth_map[i]++;
+ }
+ }
+ add_things_to_map_memory(t_eye);
+}
+
+
+