Skip to content
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

Wind "yaw" attribute doesn't loop around #992

Closed
Jigoku opened this issue Jan 8, 2020 · 0 comments
Closed

Wind "yaw" attribute doesn't loop around #992

Jigoku opened this issue Jan 8, 2020 · 0 comments

Comments

@Jigoku
Copy link
Member

@Jigoku Jigoku commented Jan 8, 2020

Noticed in game, that wind entities "yaw" can be < -360 and > 361.

I believe it needs a FIXDIRY(1) just above L1237 to solve this;

base/src/game/entities.cpp

Lines 1235 to 1246 in 293c3f8

case WIND:
{
if(e.attrs[0] < 0) e.attrs[0] = 0; // mode, clamp
if(alter && !e.attrs[1]) e.attrs[1] = (int)camera1->yaw;
while(e.attrs[2] < 0) e.attrs[2] += 256; // speed
while(e.attrs[2] > 255) e.attrs[2] -= 256; // wrap both ways
if(e.attrs[3] < 0) e.attrs[3] = 0; // radius, clamp
if(e.attrs[4] < 0) e.attrs[4] = 0; // atten, clamp
if(e.attrs[5] < 0) e.attrs[5] = 0; // interval, clamp
if(e.attrs[6] < 0) e.attrs[6] = 0; // length, clamp
break;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.