forked from MagicBane/Server
Update to ordering of logic
This commit is contained in:
@@ -310,11 +310,9 @@ public enum BuildingManager {
|
|||||||
|
|
||||||
public static void removeHireling(Building building, AbstractCharacter hireling) {
|
public static void removeHireling(Building building, AbstractCharacter hireling) {
|
||||||
|
|
||||||
Mob guardCaptain = null;
|
|
||||||
|
|
||||||
if (hireling.getObjectType().equals(GameObjectType.Mob)) {
|
if (hireling.getObjectType().equals(GameObjectType.Mob)) {
|
||||||
|
|
||||||
guardCaptain = (Mob) hireling;
|
Mob guardCaptain = (Mob) hireling;
|
||||||
|
|
||||||
// Clear minions from database if a guard captain
|
// Clear minions from database if a guard captain
|
||||||
|
|
||||||
@@ -338,6 +336,12 @@ public enum BuildingManager {
|
|||||||
|
|
||||||
building.getHirelings().remove(hireling);
|
building.getHirelings().remove(hireling);
|
||||||
|
|
||||||
|
// Unload hireling from world
|
||||||
|
|
||||||
|
DbManager.removeFromCache(hireling);
|
||||||
|
WorldGrid.RemoveWorldObject(hireling);
|
||||||
|
WorldGrid.removeObject(hireling);
|
||||||
|
|
||||||
// Delete hireling from database
|
// Delete hireling from database
|
||||||
|
|
||||||
if (hireling.getObjectType().equals(GameObjectType.Mob))
|
if (hireling.getObjectType().equals(GameObjectType.Mob))
|
||||||
@@ -345,12 +349,6 @@ public enum BuildingManager {
|
|||||||
else
|
else
|
||||||
DbManager.NPCQueries.DELETE_NPC((NPC) hireling);
|
DbManager.NPCQueries.DELETE_NPC((NPC) hireling);
|
||||||
|
|
||||||
// Unload hireling from world
|
|
||||||
|
|
||||||
DbManager.removeFromCache(hireling);
|
|
||||||
WorldGrid.RemoveWorldObject(hireling);
|
|
||||||
WorldGrid.removeObject(hireling);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user