From 77cd9663620ccd96b776c2e161dfc91dc8035b1b Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Wed, 11 Feb 2026 06:39:09 +1300 Subject: [PATCH] IdentifySpecVol effectively matching --- src/DETHRACE/common/world.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/DETHRACE/common/world.c b/src/DETHRACE/common/world.c index 5b51aadf..3a3a9af3 100644 --- a/src/DETHRACE/common/world.c +++ b/src/DETHRACE/common/world.c @@ -5464,23 +5464,25 @@ void IdentifySpecVol(void) { char s[256]; min_d = FLT_MAX; - min_index = -1; p = &gProgram_state.current_car.pos; - for (i = 0; i < gProgram_state.special_volume_count; i++) { - v = &gProgram_state.special_volumes[i]; + min_index = -1; + for (i = 0, v = gProgram_state.special_volumes; i < gProgram_state.special_volume_count; i++, v++) { + if (v->no_mat) { + continue; + } d = Vector3DistanceSquared((br_vector3*)v->mat.m[3], p); if (d < min_d) { - min_index = i; min_d = d; + min_index = i; } } - if (min_index < 0) { - gLast_actor = NULL; - NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -2, "No special volumes to lock onto"); - } else { + if (min_index >= 0) { sprintf(s, "Locked onto Special Volume #%d", min_index); NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -2, s); gLast_actor = gSpec_vol_actors[min_index]; + } else { + gLast_actor = NULL; + NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -2, "No special volumes to lock onto"); } }