Another potential fix for construction
This commit is contained in:
@@ -267,10 +267,16 @@ public final class HouseManager {
|
||||
int diffX = player.getLocation().getX() - r.getBaseLocation().getX();
|
||||
int diffY = player.getLocation().getY() - r.getBaseLocation().getY();
|
||||
int diffZ = player.getLocation().getZ() - r.getBaseLocation().getZ();
|
||||
DynamicRegion dr = region;
|
||||
DynamicRegion dd = dungeon;
|
||||
RegionManager.getRegionCache().remove(dr);
|
||||
RegionManager.getRegionCache().remove(dd);
|
||||
region = null;
|
||||
dungeon = null;
|
||||
enter(player, buildingMode, false);
|
||||
player.getProperties().setTeleportLocation((player.getViewport().getRegion() == dungeon ? dungeon : region).getBaseLocation().transform(diffX, diffY, diffZ));
|
||||
dr.flagInactive();
|
||||
dd.flagInactive();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -299,22 +299,31 @@ public class Region {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unloads a region - compatibility method for older uses
|
||||
*/
|
||||
private static void unload(Region r){
|
||||
unload(r, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unloads a region.
|
||||
* @param r The region.
|
||||
*/
|
||||
private static void unload(Region r) {
|
||||
if (r.isViewed()) {
|
||||
SystemLogger.logErr("Players viewing region!");
|
||||
r.flagActive();
|
||||
return;
|
||||
}
|
||||
for (RegionPlane p : r.planes) {
|
||||
if (!p.getPlayers().isEmpty()) {
|
||||
SystemLogger.logErr("Players still in region!");
|
||||
private static void unload(Region r, boolean force) {
|
||||
if(!force){
|
||||
if (r.isViewed()) {
|
||||
SystemLogger.logErr("Players viewing region!");
|
||||
r.flagActive();
|
||||
return;
|
||||
}
|
||||
for (RegionPlane p : r.planes) {
|
||||
if (!p.getPlayers().isEmpty()) {
|
||||
SystemLogger.logErr("Players still in region!");
|
||||
r.flagActive();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (RegionPlane p : r.planes) {
|
||||
p.clear();
|
||||
|
||||
Reference in New Issue
Block a user