Skip to content

Curved Kick Fixes #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/mad_dynmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ inline void bxbyh (const cflw<M> &m, const V &x, const V &y, T &bx, T &by)
RFOR(i,m.snm) {
btx = 0., bty = 0.;

RFOR(j,m.snm-i) { ++k;
RFOR(j,m.snm-(i+1)) { ++k;
btx = (btx + R(m.bfx[k])) * y;
bty = (bty + R(m.bfy[k])) * y;
}

++k;
btx = (bx + btx + R(m.bfx[k])) * x;
bty = (by + bty + R(m.bfy[k])) * x;
bx = (bx + btx + R(m.bfx[k])) * x;
by = (by + bty + R(m.bfy[k])) * x;
}

btx = 0., bty = 0.;
Expand All @@ -239,8 +239,8 @@ inline void bxbyh (const cflw<M> &m, const V &x, const V &y, T &bx, T &by)
bty = (bty + R(m.bfy[k])) * y;
}

bx += btx + R(m.bfx[k+1]);
by += bty + R(m.bfy[k+1]);
bx = bx + btx + R(m.bfx[k+1]); // Not using += reduces numerical instability with Lua
by = by + bty + R(m.bfy[k+1]);
}

// --- patches ----------------------------------------------------------------o
Expand Down
8 changes: 5 additions & 3 deletions src/madl_etrck.mad
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,11 @@ local function cpy_mult (m)
c.ksl[i-1] = m.ksl[i]
end

for i=1,c.snm do
c.bfx[i-1] = m.bfx[i]
c.bfy[i-1] = m.bfy[i]
if c.snm > 0 then -- bfx and bfy will have nil values otherwise
for i=1,(c.snm+1)*(c.snm+2)/2 do
c.bfx[i-1] = m.bfx[i]
c.bfy[i-1] = m.bfy[i]
end
end
end

Expand Down