From 78a0416b191dba1e7f96d4b2d5f84a72be179b9b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 24 Dec 2023 09:44:01 -0500 Subject: [PATCH] Updated city planting to conform to class refactor project. --- src/engine/db/handlers/dbCityHandler.java | 3 +++ src/engine/net/client/handlers/PlaceAssetMsgHandler.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/db/handlers/dbCityHandler.java b/src/engine/db/handlers/dbCityHandler.java index a31b738e..c93960f8 100644 --- a/src/engine/db/handlers/dbCityHandler.java +++ b/src/engine/db/handlers/dbCityHandler.java @@ -34,16 +34,19 @@ public class dbCityHandler extends dbHandlerBase { case "zone": Zone zone = new Zone(rs); DbManager.addToCache(zone); + zone.runAfterLoad(); list.add(zone); break; case "building": Building building = new Building(rs); DbManager.addToCache(building); + building.runAfterLoad(); list.add(building); break; case "city": City city = new City(rs); DbManager.addToCache(city); + city.runAfterLoad(); list.add(city); break; } diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 79f9eb10..76c26d3e 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -766,8 +766,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { cityObjectMap.put(gameObject.getObjectType(), gameObject); treeObject = (Building) cityObjectMap.get(GameObjectType.Building); - treeObject.runAfterLoad(); - cityObject = (City) cityObjectMap.get(GameObjectType.City); zoneObject = (Zone) cityObjectMap.get(GameObjectType.Zone); @@ -799,6 +797,10 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { City.lastCityUpdate = System.currentTimeMillis(); treeObject.setLoc(treeObject.getLoc()); + + // As this is a new static object set it's dirtyFlag + // so players already near it will have the object loaded. + InterestManager.setObjectDirty(treeObject); serverRealm.addCity(cityObject.getObjectUUID());