Fixed disappearing subdivisions.
Was happening on both resize and on extend downward.
This commit is contained in:
parent
3c3506bf55
commit
23ceed62a3
|
|
@ -696,6 +696,9 @@ public abstract class DataStore
|
||||||
|
|
||||||
if(claim.parent != null) claim = claim.parent;
|
if(claim.parent != null) claim = claim.parent;
|
||||||
|
|
||||||
|
//note any subdivisions
|
||||||
|
ArrayList<Claim> subdivisions = new ArrayList<Claim>(claim.children);
|
||||||
|
|
||||||
//delete the claim
|
//delete the claim
|
||||||
this.deleteClaim(claim);
|
this.deleteClaim(claim);
|
||||||
|
|
||||||
|
|
@ -703,6 +706,9 @@ public abstract class DataStore
|
||||||
claim.lesserBoundaryCorner.setY(newDepth);
|
claim.lesserBoundaryCorner.setY(newDepth);
|
||||||
claim.greaterBoundaryCorner.setY(newDepth);
|
claim.greaterBoundaryCorner.setY(newDepth);
|
||||||
|
|
||||||
|
//re-add the subdivisions (deleteClaim() removed them)
|
||||||
|
claim.children.addAll(subdivisions);
|
||||||
|
|
||||||
//make all subdivisions reach to the same depth
|
//make all subdivisions reach to the same depth
|
||||||
for(int i = 0; i < claim.children.size(); i++)
|
for(int i = 0; i < claim.children.size(); i++)
|
||||||
{
|
{
|
||||||
|
|
@ -942,6 +948,9 @@ public abstract class DataStore
|
||||||
//see CreateClaim() for details on return value
|
//see CreateClaim() for details on return value
|
||||||
synchronized public CreateClaimResult resizeClaim(Claim claim, int newx1, int newx2, int newy1, int newy2, int newz1, int newz2)
|
synchronized public CreateClaimResult resizeClaim(Claim claim, int newx1, int newx2, int newy1, int newy2, int newz1, int newz2)
|
||||||
{
|
{
|
||||||
|
//note any subdivisions before deleting the claim
|
||||||
|
ArrayList<Claim> subdivisions = new ArrayList<Claim>(claim.children);
|
||||||
|
|
||||||
//remove old claim
|
//remove old claim
|
||||||
this.deleteClaim(claim);
|
this.deleteClaim(claim);
|
||||||
|
|
||||||
|
|
@ -972,13 +981,8 @@ public abstract class DataStore
|
||||||
result.claim.managers.add(managers.get(i));
|
result.claim.managers.add(managers.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//copy subdivisions from old claim
|
//restore subdivisions
|
||||||
for(int i = 0; i < claim.children.size(); i++)
|
result.claim.children.addAll(subdivisions);
|
||||||
{
|
|
||||||
Claim subdivision = claim.children.get(i);
|
|
||||||
subdivision.parent = result.claim;
|
|
||||||
result.claim.children.add(subdivision);
|
|
||||||
}
|
|
||||||
|
|
||||||
//save those changes
|
//save those changes
|
||||||
this.saveClaim(result.claim);
|
this.saveClaim(result.claim);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user