Fix mapgen flowers being slightly offset on X axis
authorWuzzy <Wuzzy2@mail.ru>
Mon, 17 Jun 2019 19:51:05 +0200
changeset 15190 f532203c5ceb
parent 15189 e1dbe2c9026f
child 15191 3cc1a79de3fd
Fix mapgen flowers being slightly offset on X axis
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Mon Jun 17 19:33:43 2019 +0200
+++ b/hedgewars/uGears.pas	Mon Jun 17 19:51:05 2019 +0200
@@ -1064,7 +1064,7 @@
                     y:= hwRound(Gear^.Y) - SpritesData[sprTargetBee].Height div 2;
                     // Calculate offset from map boundaries and border
                     if hasBorder then
-                        x:= max(min(x, RightX - SpritesData[sprTargetBee].Width) - cBorderWidth, LeftX + cBorderWidth)
+                        x:= max(min(x, RightX - SpritesData[sprTargetBee].Width - cBorderWidth), LeftX + cBorderWidth)
                     else
                         x:= max(min(x, RightX - SpritesData[sprTargetBee].Width), LeftX);
                     y:= max(y, TopY);