mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-12-22 22:54:16 +07:00
Fixed sector generate producing inconsistent results
This commit is contained in:
parent
30328e61a5
commit
fc5b50822e
@ -93,6 +93,7 @@ public class SectorGenerateDialog extends BaseDialog{
|
|||||||
var preset = sectorobj.preset;
|
var preset = sectorobj.preset;
|
||||||
sectorobj.preset = null;
|
sectorobj.preset = null;
|
||||||
|
|
||||||
|
logic.reset(); //TODO: is this a good idea? all rules and map state are cleared, but it fixes inconsistent gen
|
||||||
world.loadSector(sectorobj, seed, false);
|
world.loadSector(sectorobj, seed, false);
|
||||||
|
|
||||||
sectorobj.preset = preset;
|
sectorobj.preset = preset;
|
||||||
|
@ -209,10 +209,12 @@ public class BaseGenerator{
|
|||||||
int cx = x - (int)rotator.x;
|
int cx = x - (int)rotator.x;
|
||||||
int cy = y - (int)rotator.y;
|
int cy = y - (int)rotator.y;
|
||||||
|
|
||||||
for(Stile tile : result.tiles){
|
if(!insanity){
|
||||||
int realX = tile.x + cx, realY = tile.y + cy;
|
for(Stile tile : result.tiles){
|
||||||
if(!insanity && isTaken(tile.block, realX, realY)){
|
int realX = tile.x + cx, realY = tile.y + cy;
|
||||||
return false;
|
if(isTaken(tile.block, realX, realY)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user