forked from MagicBane/Server
New method implemented.
This commit is contained in:
@@ -11,7 +11,6 @@ package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.DbObjectType;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.BuildingManager;
|
||||
@@ -138,54 +137,16 @@ public class RemoveObjectCmd extends AbstractDevCmd {
|
||||
Warehouse.warehouseByBuildingUUID.remove(building.getObjectUUID());
|
||||
}
|
||||
|
||||
|
||||
//remove cached shrines.
|
||||
if ((building.getBlueprintUUID() != 0)
|
||||
&& (building.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE))
|
||||
Shrine.RemoveShrineFromCacheByBuilding(building);
|
||||
|
||||
for (AbstractCharacter ac : building.getHirelings().keySet()) {
|
||||
NPC npc = null;
|
||||
Mob mobA = null;
|
||||
// Remove hirelings for this building
|
||||
|
||||
if (ac.getObjectType() == GameObjectType.NPC)
|
||||
npc = (NPC) ac;
|
||||
else if (ac.getObjectType() == GameObjectType.Mob)
|
||||
mobA = (Mob) ac;
|
||||
for (AbstractCharacter abstractCharacter : building.getHirelings().keySet())
|
||||
BuildingManager.removeHireling(building, abstractCharacter);
|
||||
|
||||
if (npc != null) {
|
||||
|
||||
for (Integer minionUUID : npc.minions) {
|
||||
Mob minionMob = Mob.getMob(minionUUID);
|
||||
WorldGrid.RemoveWorldObject(minionMob);
|
||||
WorldGrid.removeObject(minionMob, pc);
|
||||
|
||||
if (minionMob.getParentZone() != null)
|
||||
minionMob.getParentZone().zoneMobSet.remove(minionMob);
|
||||
}
|
||||
|
||||
DbManager.NPCQueries.DELETE_NPC(npc);
|
||||
DbManager.removeFromCache(npc);
|
||||
WorldGrid.RemoveWorldObject(npc);
|
||||
WorldGrid.removeObject(npc, pc);
|
||||
} else if (mobA != null) {
|
||||
|
||||
for (Integer minionUUID : mobA.minions) {
|
||||
Mob minionMob = Mob.getMob(minionUUID);
|
||||
WorldGrid.RemoveWorldObject(minionMob);
|
||||
WorldGrid.removeObject(minionMob, pc);
|
||||
|
||||
if (minionMob.getParentZone() != null)
|
||||
minionMob.getParentZone().zoneMobSet.remove(minionMob);
|
||||
}
|
||||
DbManager.MobQueries.DELETE_MOB(mobA);
|
||||
DbManager.removeFromCache(mobA);
|
||||
WorldGrid.RemoveWorldObject(mobA);
|
||||
WorldGrid.removeObject(mobA, pc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Zone zone = building.getParentZone();
|
||||
DbManager.BuildingQueries.DELETE_FROM_DATABASE(building);
|
||||
DbManager.removeFromCache(building);
|
||||
|
||||
Reference in New Issue
Block a user