Browse Source

bugfix in ./remove dev cmd.

master
MagicBot 2 years ago
parent
commit
f85fb8f224
  1. 13
      src/engine/devcmd/cmds/RemoveObjectCmd.java

13
src/engine/devcmd/cmds/RemoveObjectCmd.java

@ -204,7 +204,10 @@ public class RemoveObjectCmd extends AbstractDevCmd {
return; return;
} }
// Remove npc from hirelings list.
if (npc.building != null)
npc.building.getHirelings().remove(npc);
for (Mob mob : npc.getSiegeMinionMap().keySet()) { for (Mob mob : npc.getSiegeMinionMap().keySet()) {
WorldGrid.RemoveWorldObject(mob); WorldGrid.RemoveWorldObject(mob);
@ -225,6 +228,7 @@ public class RemoveObjectCmd extends AbstractDevCmd {
private void removeMob(PlayerCharacter pc, Mob mob) { private void removeMob(PlayerCharacter pc, Mob mob) {
Zone currentZone = ZoneManager.findSmallestZone(pc.getLoc()); Zone currentZone = ZoneManager.findSmallestZone(pc.getLoc());
if (currentZone == null) { if (currentZone == null) {
this.throwbackError(pc, "Could not locate zone for player."); this.throwbackError(pc, "Could not locate zone for player.");
return; return;
@ -235,8 +239,13 @@ public class RemoveObjectCmd extends AbstractDevCmd {
return; return;
} }
mob.setLoc(Vector3fImmutable.ZERO); //Move it off the plane.. // Remove npc from hirelings list.
mob.setBindLoc(Vector3fImmutable.ZERO); //Reset the bind loc..
if (mob.building != null)
mob.building.getHirelings().remove(mob);
mob.setLoc(Vector3fImmutable.ZERO); //Move it off the plane..
mob.setBindLoc(Vector3fImmutable.ZERO); //Reset the bind loc..
//mob.setHealth(-1, pc); //Kill it! //mob.setHealth(-1, pc); //Kill it!
DbManager.MobQueries.DELETE_MOB(mob); DbManager.MobQueries.DELETE_MOB(mob);

Loading…
Cancel
Save