Browse Source

Updated city planting to conform to class refactor project.

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
78a0416b19
  1. 3
      src/engine/db/handlers/dbCityHandler.java
  2. 6
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java

3
src/engine/db/handlers/dbCityHandler.java

@ -34,16 +34,19 @@ public class dbCityHandler extends dbHandlerBase {
case "zone": case "zone":
Zone zone = new Zone(rs); Zone zone = new Zone(rs);
DbManager.addToCache(zone); DbManager.addToCache(zone);
zone.runAfterLoad();
list.add(zone); list.add(zone);
break; break;
case "building": case "building":
Building building = new Building(rs); Building building = new Building(rs);
DbManager.addToCache(building); DbManager.addToCache(building);
building.runAfterLoad();
list.add(building); list.add(building);
break; break;
case "city": case "city":
City city = new City(rs); City city = new City(rs);
DbManager.addToCache(city); DbManager.addToCache(city);
city.runAfterLoad();
list.add(city); list.add(city);
break; break;
} }

6
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -766,8 +766,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
cityObjectMap.put(gameObject.getObjectType(), gameObject); cityObjectMap.put(gameObject.getObjectType(), gameObject);
treeObject = (Building) cityObjectMap.get(GameObjectType.Building); treeObject = (Building) cityObjectMap.get(GameObjectType.Building);
treeObject.runAfterLoad();
cityObject = (City) cityObjectMap.get(GameObjectType.City); cityObject = (City) cityObjectMap.get(GameObjectType.City);
zoneObject = (Zone) cityObjectMap.get(GameObjectType.Zone); zoneObject = (Zone) cityObjectMap.get(GameObjectType.Zone);
@ -799,6 +797,10 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
City.lastCityUpdate = System.currentTimeMillis(); City.lastCityUpdate = System.currentTimeMillis();
treeObject.setLoc(treeObject.getLoc()); 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); InterestManager.setObjectDirty(treeObject);
serverRealm.addCity(cityObject.getObjectUUID()); serverRealm.addCity(cityObject.getObjectUUID());

Loading…
Cancel
Save