# HG changeset patch # User Wuzzy # Date 1508501876 -7200 # Node ID 5a57acce9caea05bd6d7547641c4b4ef73772522 # Parent 927b35f59a4645b6d4ef3f7bc1fcc1b644db8930 Fix bubbles drawn on the wrong side when hog drowns and faces right diff -r 927b35f59a46 -r 5a57acce9cae hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Fri Oct 20 13:34:05 2017 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Fri Oct 20 14:17:56 2017 +0200 @@ -260,7 +260,7 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepDrowningGear(Gear: PGear); -var i, d: LongInt; +var i, d, bubbleX, bubbleY: LongInt; bubble: PVisualGear; begin if Gear^.Timer = 0 then @@ -292,12 +292,17 @@ Gear^.X := Gear^.X + Gear^.dX * cDrownSpeed; // Create some bubbles (0.5% might be better but causes too few bubbles sometimes) +if (Gear^.Kind = gtHedgehog) and (Gear^.dX.isNegative) then + bubbleX:= hwRound(Gear^.X) - Gear^.Radius +else + bubbleX:= hwRound(Gear^.X) + Gear^.Radius; +bubbleY:= hwRound(Gear^.Y) - Gear^.Radius; if ((not SuddenDeathDmg and (WaterOpacity < $FF)) or (SuddenDeathDmg and (SDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then - AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble) + AddVisualGear(bubbleX, bubbleY, vgtBubble) else if Random(12) = 0 then - AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble); + AddVisualGear(bubbleX, bubbleY, vgtBubble); if (not SuddenDeathDmg and (WaterOpacity > $FE)) or (SuddenDeathDmg and (SDWaterOpacity > $FE)) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then