summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/ray/ray_scene.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/modules/ray/ray_scene.c b/src/modules/ray/ray_scene.c
index eb18d08..50da28a 100644
--- a/src/modules/ray/ray_scene.c
+++ b/src/modules/ray/ray_scene.c
@@ -155,8 +155,7 @@ static ray_color_t trace_ray(ray_scene_t *scene, ray_ray_t *ray, unsigned depth)
if (ray_object_intersects_ray(&scene->objects[i], ray, &distance)) {
/* Is it the nearest intersection? */
- if (!nearest_object ||
- distance < nearest_object_distance) {
+ if (distance < nearest_object_distance) {
nearest_object = &scene->objects[i];
nearest_object_distance = distance;
}
© All Rights Reserved