X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fswim.c;h=e20655a2935b1e3b7a536d4ae82c6516a31f5264;hp=a1ddefe1c60d6b24e820e12231c458f78a549abb;hb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;hpb=ccb7f4903325f92555a9722bba74b58346654ba0 diff --git a/hacks/glx/swim.c b/hacks/glx/swim.c index a1ddefe1..e20655a2 100644 --- a/hacks/glx/swim.c +++ b/hacks/glx/swim.c @@ -109,7 +109,6 @@ WhalePilot(fishRec * fish, float whalespeed, Bool whaledir) void SharkPilot(fishRec * fish, float sharkspeed) { - static int sign = 1; float X, Y, Z, tpsi, ttheta, thetal; fish->xt = 60000.0; @@ -157,9 +156,9 @@ SharkPilot(fishRec * fish, float sharkspeed) } } else { if (NRAND(100) > 98) { - sign = 1 - sign; + fish->sign = (fish->sign < 0 ? 1 : -1); } - fish->psi += sign; + fish->psi += (fish->sign ? 1 : -1); if (fish->psi > 180.0) { fish->psi -= 360.0; }