hedgewars/GSHandlers.inc
changeset 5871 09daa06191d7
parent 5870 b9b9fb00c9dd
child 5873 4f2d8ce3732b
--- a/hedgewars/GSHandlers.inc	Mon Sep 12 00:47:49 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Sun Sep 11 21:30:42 2011 -0400
@@ -512,6 +512,7 @@
     i, gX, gY: LongInt;
     dX, dY: hwFloat;
     Fire: PGear;
+    smoke: PVisualGear;
 begin
     AllInactive := false;
 
@@ -519,9 +520,12 @@
     CalcRotationDirAngle(Gear);
 
     // let's add some smoke depending on speed
-    i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120));
+    i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120))+random(10);
     if (GameTicks mod i) = 0 then
-        AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
+        begin
+        smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
+        if smoke <> nil then smoke^.Scale:= 0.75;
+        end;
 
     if (Gear^.State and gstCollision) <> 0 then
     begin