mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-12-22 23:44:00 +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;
|
||||
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);
|
||||
|
||||
sectorobj.preset = preset;
|
||||
|
@ -209,12 +209,14 @@ public class BaseGenerator{
|
||||
int cx = x - (int)rotator.x;
|
||||
int cy = y - (int)rotator.y;
|
||||
|
||||
if(!insanity){
|
||||
for(Stile tile : result.tiles){
|
||||
int realX = tile.x + cx, realY = tile.y + cy;
|
||||
if(!insanity && isTaken(tile.block, realX, realY)){
|
||||
if(isTaken(tile.block, realX, realY)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//only do callback after validation
|
||||
for(Stile tile : result.tiles){
|
||||
|
Loading…
Reference in New Issue
Block a user