fix for Issue 611: Engine crash in portal code 0.9.19
authorsheepluva
Tue, 16 Apr 2013 17:31:39 +0200
branch0.9.19
changeset 8898 0ccaa19c6367
parent 8896 fea1993ded33
child 8900 b77fd3c2eec5
fix for issue #611: Engine crash in portal code
hedgewars/GSHandlers.inc
share/hedgewars/Data/Locale/en.txt
--- a/hedgewars/GSHandlers.inc	Tue Apr 16 12:24:13 2013 +0200
+++ b/hedgewars/GSHandlers.inc	Tue Apr 16 17:31:39 2013 +0200
@@ -3683,7 +3683,11 @@
             // wow! good candidate there, let's see if the distance and direction is okay!
             if hasdxy then
                 begin
-                s := r / Distance(iterator^.dX, iterator^.dY);
+                s: = Distance(iterator^.dX, iterator^.dY);
+                // if the resulting distance is 0 skip this gear
+                if s.QWordValue = 0 then
+                    continue;
+                s := r / s
                 ox:= iterator^.X + s * iterator^.dX;
                 oy:= iterator^.Y + s * iterator^.dY;
                 end
--- a/share/hedgewars/Data/Locale/en.txt	Tue Apr 16 12:24:13 2013 +0200
+++ b/share/hedgewars/Data/Locale/en.txt	Tue Apr 16 17:31:39 2013 +0200
@@ -511,7 +511,7 @@
 04:53=Take a trip through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King.|Attack: Activate
 04:54=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you!|Attack: Activate|Up/Down: Continue aiming|Left/Right: Modify spitting power
 04:55=Bring back the ice-age!|Freeze hedgehogs, make the floor slippery or|save yourself from drowning by freezing the water.|Attack: Shoot
-04:56=You can throw two cleavers at your enemy,|block passages and tunnels and even use them for climbing!|Be careful: Playing with knifes is dangerous.|Attack: Hold to shoot with more power (twice)
+04:56=You can throw two cleavers at your enemy,|block passages and tunnels and even use them for climbing!|Be careful! Playing with knifes is dangerous.|Attack: Hold to shoot with more power (twice)
 
 ; Game goal strings
 05:00=Game Modes