From a1753a28ec6fb7956fd43baf22a0a1f5f3657c01 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 13 Sep 2023 07:29:29 -0400 Subject: [PATCH] Player cities write correct offset. --- src/engine/gameManager/ZoneManager.java | 1 + src/engine/net/client/handlers/PlaceAssetMsgHandler.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 49c42da4..8c50d995 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -476,6 +476,7 @@ public enum ZoneManager { worldAlttitude = HeightMap.getWorldHeight(parentZone, zone.getLoc()); // Add zone offset to value + worldAlttitude += zone.getYCoord(); return worldAlttitude; diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 1fca649b..e38d44b3 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -745,7 +745,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { } Vector3fImmutable plantLoc = new Vector3fImmutable(treeInfo.getLoc().x, - HeightMap.getWorldHeight(treeInfo.getLoc()), + 0, treeInfo.getLoc().z); cityObjects = DbManager.CityQueries.CREATE_CITY(playerCharacter.getObjectUUID(), serverZone.getObjectUUID(), @@ -754,6 +754,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { plantLoc.z - serverZone.getAbsZ(), treeInfo.getRot().y, treeInfo.getW(), playerCharacter.getGuild().getName(), LocalDateTime.now()); // Uh oh! + if (cityObjects == null || cityObjects.isEmpty()) { PlaceAssetMsg.sendPlaceAssetError(origin, 1, "A Serious error has occurred. Please post details for to ensure transaction integrity"); return false;