diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 4cd6c2884..07ddd95ef 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -23,7 +23,7 @@ void resetlanepics(void); void moveplayers(); void doanimations(); void movefx(); -void moveclouds(void); +void moveclouds(double smoothratio); void RANDOMSCRAP(spritetype* s, int i); void ms(short i); diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 9df3f8346..801ceeee7 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -1140,11 +1140,13 @@ void allignwarpelevators(void) // //--------------------------------------------------------------------------- -void moveclouds(void) +void moveclouds(double smoothratio) { - if (gameclock > cloudclock || gameclock < (cloudclock - 7)) + // The math here is very messy... :( + int myclock = smoothratio < 32768? ud.levelclock-2 : ud.levelclock; + if (myclock > cloudclock || myclock < (cloudclock - 7)) { - cloudclock = gameclock + 6; + cloudclock = myclock + 6; // cloudx/y were an array, but all entries were always having the same value so a single pair is enough. cloudx += (sintable[(ps[screenpeek].getang() + 512) & 2047] >> 9);