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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user