811 |
811 |
812 procedure AssignHHCoords; |
812 procedure AssignHHCoords; |
813 var i, t, p, j: LongInt; |
813 var i, t, p, j: LongInt; |
814 ar: array[0..Pred(cMaxHHs)] of PHedgehog; |
814 ar: array[0..Pred(cMaxHHs)] of PHedgehog; |
815 Count: Longword; |
815 Count: Longword; |
816 divide, sectionDivide: boolean; |
816 divide: boolean; |
817 begin |
817 begin |
818 if (GameFlags and gfPlaceHog) <> 0 then |
818 if (GameFlags and gfPlaceHog) <> 0 then |
819 PlacingHogs:= true; |
819 PlacingHogs:= true; |
820 |
820 |
821 divide:= ((GameFlags and gfDivideTeams) <> 0); |
821 divide:= ((GameFlags and gfDivideTeams) <> 0); |
822 sectionDivide:= divide and ((GameFlags and gfForts) <> 0); |
|
823 |
|
824 // TODO: there might be a smarter way to decide if dividing clans into equal-width map sections makes sense |
|
825 // e.g. by checking if there is enough spawn area in each section |
|
826 if divide and (not sectionDivide) then |
|
827 sectionDivide:= (ClansCount = 2); |
|
828 |
822 |
829 // in section-divide mode, divide the map into equal-width sections and put each clan in one of them |
823 // in section-divide mode, divide the map into equal-width sections and put each clan in one of them |
830 if sectionDivide then |
824 if divide then |
831 begin |
825 begin |
832 t:= leftX; |
826 t:= leftX; |
833 for p:= 0 to (ClansCount - 1) do |
827 for p:= 0 to (ClansCount - 1) do |
834 begin |
828 begin |
835 with SpawnClansArray[p]^ do |
829 with SpawnClansArray[p]^ do |