From 84f11b37d178242d4ff80c4f3b4eddb54efe59ea Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Sun, 23 Nov 2025 19:47:02 +0100 Subject: Don't reorder parameters --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 0798c94..7f3ec26 100644 --- a/src/main.c +++ b/src/main.c @@ -326,18 +326,18 @@ int main(int argc, char *argv[]) { if(!constraints.elements[i].used) continue; if(constraints.elements[i].order == 0) continue; - params[constraints.elements[i].order-1] = SETSIGN(constraints.elements[i].forward, constraints.elements[i].v); + params[i] = SETSIGN(constraints.elements[i].forward, constraints.elements[i].v); // We need to offset angles based on the path we took to use this // constraint if(constraints.elements[i].path[0].i != -1) { // printf("PATH %ld order %llu\n", i, constraints[i].order-1); for(struct path_step *p = constraints.elements[i].path; p <= constraints.elements[i].path+SEARCH_DEPTH && p->i != -1; p++) { - params[constraints.elements[i].order-1] += SETSIGN(p->direction, constraints.elements[p->i].v); + params[i] += SETSIGN(p->direction, constraints.elements[p->i].v); // printf("%llu [%d:%f] [%f] -> ", p->i, p->direction, constraints[p->i].v, params[constraints[i].order-1]); } // printf("\n"); - params[constraints.elements[i].order-1] -= (M_PI*2.0) * floor(params[constraints.elements[i].order-1] / (M_PI*2.0)); + params[i] -= (M_PI*2.0) * floor(params[i] / (M_PI*2.0)); // printf("Final Angle is %f\n", params[constraints[i].order-1]); } -- cgit v1.2.3