Merge branch 'construction-cbt' into 'master'
Another potential fix for construction See merge request 2009scape/2009scape!108
This commit is contained in:
@@ -267,10 +267,16 @@ public final class HouseManager {
|
|||||||
int diffX = player.getLocation().getX() - r.getBaseLocation().getX();
|
int diffX = player.getLocation().getX() - r.getBaseLocation().getX();
|
||||||
int diffY = player.getLocation().getY() - r.getBaseLocation().getY();
|
int diffY = player.getLocation().getY() - r.getBaseLocation().getY();
|
||||||
int diffZ = player.getLocation().getZ() - r.getBaseLocation().getZ();
|
int diffZ = player.getLocation().getZ() - r.getBaseLocation().getZ();
|
||||||
|
DynamicRegion dr = region;
|
||||||
|
DynamicRegion dd = dungeon;
|
||||||
|
RegionManager.getRegionCache().remove(dr);
|
||||||
|
RegionManager.getRegionCache().remove(dd);
|
||||||
region = null;
|
region = null;
|
||||||
dungeon = null;
|
dungeon = null;
|
||||||
enter(player, buildingMode, false);
|
enter(player, buildingMode, false);
|
||||||
player.getProperties().setTeleportLocation((player.getViewport().getRegion() == dungeon ? dungeon : region).getBaseLocation().transform(diffX, diffY, diffZ));
|
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.
|
* Unloads a region.
|
||||||
* @param r The region.
|
* @param r The region.
|
||||||
*/
|
*/
|
||||||
private static void unload(Region r) {
|
private static void unload(Region r, boolean force) {
|
||||||
if (r.isViewed()) {
|
if(!force){
|
||||||
SystemLogger.logErr("Players viewing region!");
|
if (r.isViewed()) {
|
||||||
r.flagActive();
|
SystemLogger.logErr("Players viewing region!");
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (RegionPlane p : r.planes) {
|
|
||||||
if (!p.getPlayers().isEmpty()) {
|
|
||||||
SystemLogger.logErr("Players still in region!");
|
|
||||||
r.flagActive();
|
r.flagActive();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
for (RegionPlane p : r.planes) {
|
||||||
|
if (!p.getPlayers().isEmpty()) {
|
||||||
|
SystemLogger.logErr("Players still in region!");
|
||||||
|
r.flagActive();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (RegionPlane p : r.planes) {
|
for (RegionPlane p : r.planes) {
|
||||||
p.clear();
|
p.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user