Bug#392774: wormux: blocks the whole X session when GNU touches the first object

Tuukka Hastrup Tuukka.Hastrup at iki.fi
Sun Nov 12 02:11:44 CET 2006


Hi,
I had a look at this bug and one simple fix you could at least do is 
switch the possibly endless loops into an fmod function call. This would 
reduce the severity of this bug significantly.

--- src/weapon/gnu.cpp.orig     2006-11-12 01:08:13.000000000 +0200
+++ src/weapon/gnu.cpp  2006-11-12 01:12:57.000000000 +0200
@@ -80,8 +80,7 @@
   //sometimes, angle==infinite (according to gdb) ??
   GetSpeed(norme, angle);

-  while(angle < -M_PI) angle += M_PI;
-  while(angle > M_PI) angle -= M_PI;
+  angle = fmod(angle, M_PI);

   angle *= 180.0 / M_PI;
   angle /= 2.0;

And #include <math.h>

By the way, there seem to be similarily unnecessary loops in 
src/graphic/sprite.cpp, src/map/ground.cpp, src/map/water.cpp


Regards,
Tuukka Hastrup

-- 
-- Trying to catch me? Just follow up my Electric Fingerprints
-- To help you: Tuukka.Hastrup at iki.fi
                http://www.iki.fi/Tuukka.Hastrup/




More information about the Pkg-games-devel mailing list