diff --git a/map.cpp b/map.cpp index 38e31fd..fd396db 100644 --- a/map.cpp +++ b/map.cpp @@ -250,12 +250,12 @@ void Sight_map::add_point(Tripoint p) seen.push_back( p ); } -bool Sight_map::is_initialized() +bool Sight_map::is_initialized() const { return initialized; } -bool Sight_map::can_see(Tripoint p) +bool Sight_map::can_see(Tripoint p) const { for (int i = 0; i < seen.size(); i++) { if (seen[i] == p) { @@ -2405,8 +2405,8 @@ void Map::build_tile_sight_map(int tile_x, int tile_y, int tile_z, int range) max_x = SUBMAP_SIZE * MAP_SIZE - 1; } int max_y = tile_y + range; - if (may_y > SUBMAP_SIZE * MAP_SIZE - 1) { - may_y = SUBMAP_SIZE * MAP_SIZE - 1; + if (max_y > SUBMAP_SIZE * MAP_SIZE - 1) { + max_y = SUBMAP_SIZE * MAP_SIZE - 1; } int max_z = tile_z + range; if (max_z > VERTICAL_MAP_SIZE * 2) { @@ -2416,6 +2416,14 @@ void Map::build_tile_sight_map(int tile_x, int tile_y, int tile_z, int range) for (int x = min_x; x <= max_x; x++) { for (int y = min_y; y <= max_y; y++) { for (int z = min_z; z <= max_z; z++) { + // FIXME: something horrible happened in 8635e2ec3f714a7b6549b70cfadd36e38ef8c6b1 + } + // FIXME: something horrible happened in 8635e2ec3f714a7b6549b70cfadd36e38ef8c6b1 + } + // FIXME: something horrible happened in 8635e2ec3f714a7b6549b70cfadd36e38ef8c6b1 + } + // FIXME: something horrible happened in 8635e2ec3f714a7b6549b70cfadd36e38ef8c6b1 +} /* Still using Cataclysm/DDA style LOS. It sucks and is slow and I hate it. * Basically, iterate over all Bresenham lines between [x0,y0] and [x1,y1]. diff --git a/map.h b/map.h index 0dff643..5bab9cb 100644 --- a/map.h +++ b/map.h @@ -245,6 +245,8 @@ class Map // If force_rebuild is false, we skip any tiles for which the Sight_map is // already initialized. void build_sight_map(int range = -1, bool force_rebuild = false); +// FIXME: helper, shouldn't de declared here? + void build_tile_sight_map(int tile_x, int tile_y, int tile_z, int range); bool senses(int x0, int y0, int x1, int y1, int range, Sense_type sense); bool senses(int x0, int y0, int z0, int x1, int y1, int z1, int range,