keep the saved width and height of sector (#236)

* keep the saved width and height of sector

width,height changed after expandSector mission, It will reset to original value in initSector()

* keep x,y of sector

sector X and Y may be shifted after loading as well.
This commit is contained in:
LQ
2018-10-13 22:44:07 +08:00
committed by Anuken
parent 6a5e31c908
commit 6f87611d67

View File

@@ -269,8 +269,19 @@ public class Sectors{
Array<Sector> out = Settings.getObject("sectors", Array.class, Array::new);
for(Sector sector : out){
short x = sector.x;
short y = sector.y;
int w = sector.width;
int h = sector.height;
createTexture(sector);
initSector(sector);
sector.x = x;
sector.y = y;
sector.width = w;
sector.height = h;
for(int cx = 0; cx < sector.width; cx++){
for(int cy = 0; cy < sector.height; cy++){
grid.put(sector.x + cx, sector.y + cy, sector);