# HG changeset patch # User nemo # Date 1292998666 18000 # Node ID f9356de370bb5a651d8e97d7da7269a19cc1e421 # Parent 42aad2cd981ea37f666dd29dd6330e8bac848ef3 fix desync in snow diff -r 42aad2cd981e -r f9356de370bb hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Wed Dec 22 01:11:48 2010 -0500 +++ b/hedgewars/uLandObjects.pas Wed Dec 22 01:17:46 2010 -0500 @@ -364,7 +364,7 @@ procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects); var s: shortstring; f: textfile; - i, ii: LongInt; + i, ii, numFlakes: LongInt; c1, c2: TSDL_Color; procedure CheckRect(Width, Height, x, y, w, h: LongWord); @@ -456,16 +456,17 @@ Readln(f, vobFramesCount, vobFrameTicks, vobVelocity, vobFallSpeed); // adjust amount of flakes scaled by screen space -vobCount:= longint(vobCount) * cScreenSpace div LAND_WIDTH; +vobCount:= longint(vobCount); +numFlakes:= vobCount * cScreenSpace div LAND_WIDTH; if (cReducedQuality and rqKillFlakes) <> 0 then - vobCount:= 0; + numFlakes:= 0; if Theme <> 'Snow' then - for i:= 0 to Pred(vobCount) do + for i:= 0 to Pred(numFlakes) do AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake) else - for i:= 0 to Pred(vobCount div 3) do + for i:= 0 to Pred(numFlakes div 3) do AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake); Close(f);