Fix memory corrupt due to wrong parameter in sizeof()
authorunc0rr
Thu, 13 Mar 2008 20:21:45 +0000
changeset 812 cbc392576990
parent 811 b3b9b9263d78
child 813 36fffe78ff11
Fix memory corrupt due to wrong parameter in sizeof()
hedgewars/uVisualGears.pas
--- a/hedgewars/uVisualGears.pas	Tue Mar 11 19:13:04 2008 +0000
+++ b/hedgewars/uVisualGears.pas	Thu Mar 13 20:21:45 2008 +0000
@@ -75,8 +75,8 @@
 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
 begin
 Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps;
-if hwRound(Gear^.Y) > -160 then Gear^.dY:= Gear^.dY - _1div50000
-                           else Gear^.dY:= Gear^.dY + _1div50000;
+if hwRound(Gear^.Y) > -160 then Gear^.dY:= Gear^.dY - _1div50000 * Steps
+                           else Gear^.dY:= Gear^.dY + _1div50000 * Steps;
 
 Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
 
@@ -95,7 +95,7 @@
 var Result: PVisualGear;
 begin
 New(Result);
-FillChar(Result^, sizeof(TVisualGearType), 0);
+FillChar(Result^, sizeof(TVisualGear), 0);
 Result^.X:= int2hwFloat(X);
 Result^.Y:= int2hwFloat(Y);
 Result^.Kind := Kind;