diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/beam.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/los.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/mon-los.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/ray.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/ray.h | 8 |
5 files changed, 5 insertions, 16 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 477dabc980..39bd4313ec 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1598,10 +1598,7 @@ void bolt::apply_beam_conducts() void bolt::choose_ray() { if (!chose_ray || reflections > 0) - { - ray.fullray_idx = -1; // to quiet valgrind find_ray( source, target, true, ray, 0, true ); - } } diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 77b81d240c..f7a77bd82f 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -202,7 +202,7 @@ static std::vector<int> _find_nonduped_cellrays() static bool _register_ray( double accx, double accy, double slope ) { int xpos[LOS_MAX_RANGE * 2 + 1], ypos[LOS_MAX_RANGE * 2 + 1]; - int raylen = shoot_ray( accx, accy, slope, LOS_MAX_RANGE, xpos, ypos ); + int raylen = shoot_ray(accx, accy, slope, LOS_MAX_RANGE, xpos, ypos); // Early out if ray already exists. if (_is_duplicate_ray(raylen, xpos, ypos)) @@ -644,8 +644,6 @@ int num_feats_between(const coord_def& source, const coord_def& target, int count = 0; int max_dist = grid_distance(source, target); - ray.fullray_idx = -1; // to quiet valgrind - // We don't need to find the shortest beam, any beam will suffice. find_ray( source, target, true, ray, 0, false, true ); diff --git a/crawl-ref/source/mon-los.cc b/crawl-ref/source/mon-los.cc index 17ad5c3e16..8de3f8a2b0 100644 --- a/crawl-ref/source/mon-los.cc +++ b/crawl-ref/source/mon-los.cc @@ -364,7 +364,6 @@ void monster_los::check_los_beam(int dx, int dy) continue; dist = 0; - ray.fullray_idx = -1; // to quiet valgrind find_ray( coord_def(gridx, gridy), coord_def(tx, ty), true, ray, 0, true, true ); diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc index 35b17ab104..a4bb3b21f0 100644 --- a/crawl-ref/source/ray.cc +++ b/crawl-ref/source/ray.cc @@ -102,9 +102,8 @@ int shoot_ray(double accx, double accy, const double slope, return cellnum; } - -ray_def::ray_def() : accx(0.0), accy(0.0), slope(0.0), quadrant(0), - fullray_idx(0) +ray_def::ray_def() + : accx(0.0), accy(0.0), slope(0.0), quadrant(0), fullray_idx(-1) { } diff --git a/crawl-ref/source/ray.h b/crawl-ref/source/ray.h index 617385f5eb..8816c20171 100644 --- a/crawl-ref/source/ray.h +++ b/crawl-ref/source/ray.h @@ -16,12 +16,8 @@ public: double accx; double accy; double slope; - // Quadrant 1: down-right - // Quadrant 2: down-left - // Quadrant 3: up-left - // Quadrant 4: up-right - int quadrant; - int fullray_idx; // for cycling: where did we come from? + int quadrant; // 0 down-right, 1 down-left, 2 up-left, 3 up-right + int fullray_idx; // for cycling: where did we come from? public: ray_def(); |