make hog fallback (flower-in-hole) positioning respect limits (e.g. used by gfDivideTeams)
authorsheepluva
Wed, 27 Apr 2016 23:52:43 +0200
changeset 11756 20e0a72e0e2c
parent 11755 f146a3d71340
child 11757 3c66845947a8
make hog fallback (flower-in-hole) positioning respect limits (e.g. used by gfDivideTeams)
hedgewars/uGears.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGears.pas	Wed Apr 27 23:14:47 2016 +0200
+++ b/hedgewars/uGears.pas	Wed Apr 27 23:52:43 2016 +0200
@@ -912,8 +912,7 @@
 
 
 // divided teams: sort the hedgehogs from left to right by clan and shuffle clan members
-// let's do this even after a possible section-divide, because some hogs may have spawned randomly on flowers
-if divide then
+if divide and (not sectionDivide) then
     SortHHsByClan();
 end;
 
--- a/hedgewars/uGearsUtils.pas	Wed Apr 27 23:14:47 2016 +0200
+++ b/hedgewars/uGearsUtils.pas	Wed Apr 27 23:52:43 2016 +0200
@@ -939,7 +939,7 @@
             while (cnt < 1000) do
                 begin
                 inc(cnt);
-                x:= leftX+GetRandom(rightX-leftX-32)+16;
+                x:= left+GetRandom(right-left-2*cHHRadius)+cHHRadius;
                 y:= topY+GetRandom(LAND_HEIGHT-topY-64)+48;
                 if NoGearsToAvoid(x, y, 100 div max(1,cnt div 100), 100 div max(1,cnt div 100)) then
                     begin