Fixed construction issue relating to incorrect isloaded checks causing null scenery

Fixed construction issue relating to houseregionid getting registered for dunegon id
Fixed construction issue relating to teleports in houses
This commit is contained in:
Skal Fate
2023-02-16 22:16:46 +00:00
committed by Ryan
parent 79696dfdde
commit f243293e8c
3 changed files with 7 additions and 130 deletions
@@ -225,7 +225,7 @@ public final class HouseManager {
public boolean pulse() {
spawnServant();
if (servant.isGreet()){
player.getDialogueInterpreter().sendDialogues(servant.getType().getId(), servant.getType().getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "Welcome.");
player.getDialogueInterpreter().sendDialogues(servant.getType().getId(), servant.getType().getId() == 4243 ? FacialExpression.HAPPY : null, "Welcome.");
}
return true;
}
@@ -252,7 +252,7 @@ public final class HouseManager {
}
if (house.isInHouse(player)) {
player.animate(Animation.RESET);
player.setLocation(house.location.getExitLocation());
player.getProperties().setTeleportLocation(house.location.getExitLocation());
}
}
@@ -743,8 +743,11 @@ public final class HouseManager {
* Checks if the house region was constructed and active.
* @return {@code True} if an active region for the house exists.
*/
//public boolean isLoaded() {
// return (houseRegion != null) || (dungeonRegion != null);
//}
public boolean isLoaded() {
return (houseRegion != null) || (dungeonRegion != null);
return (houseRegion != null && houseRegion.isActive()) || (dungeonRegion != null && dungeonRegion.isActive());
}
/**
@@ -46,7 +46,7 @@ public final class HouseZone extends MapZone {
}
registerRegion(house.getHouseRegion().getId());
if (house.getDungeonRegion() != null) {
registerRegion(house.getHouseRegion().getId());
registerRegion(house.getDungeonRegion().getId());
}
}