From 21bc195213f659e34c7f9e9afd7fa5f7456079fb Mon Sep 17 00:00:00 2001 From: LQ Date: Mon, 15 Oct 2018 22:17:52 +0800 Subject: [PATCH] make sure new sector include target sector (#244) if shiftx, shifty calc from total width,height, the result sector did not include the target sector --- core/src/io/anuke/mindustry/maps/Sectors.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index adc7ca0a90..49551d6c3d 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -370,7 +370,7 @@ public class Sectors{ for(int x = 1; x <= width; x++){ for(int y = 1; y <= height; y++){ for(GridPoint2 point : Geometry.d8edge){ - int shiftx = (int)(-width/2f + (point.x * (width - 1))/2f), shifty = (int)(-height/2f + (point.y * (height - 1))/2f); + int shiftx = (int)(-x/2f + (point.x * (x - 1))/2f), shifty = (int)(-y/2f + (point.y * (y - 1))/2f); if(canFit(sector.x + shiftx, sector.y + shifty, x, y)){ finalWidth = x; finalHeight = y;