duplicate zoneMobSet additions fixed

This commit is contained in:
FatBoy committed 2023-05-09 20:27:24 -05:00
1 parent f99698feda
commit 584ad46b75
3 files changed
+9 -3

No files matched your search

+5 -2
View File
@@ -918,10 +918,10 @@ public class NPC extends AbstractCharacter {
if (this.parentZone != null) {
if (zone.getObjectUUID() != this.parentZone.getObjectUUID()) {
this.parentZone.zoneNPCSet.remove(this);
zone.zoneNPCSet.add(this);
//zone.zoneNPCSet.add(this);
}
} else {
zone.zoneNPCSet.add(this);
//zone.zoneNPCSet.add(this);
}
} else if (this.parentZone != null) {
this.parentZone.zoneNPCSet.remove(this);
@@ -988,6 +988,9 @@ public class NPC extends AbstractCharacter {
if (npcWithoutID.mobBase == null) {
return null;
}
if (parent != null) {
npcWithoutID.setRelPos(parent, spawn.x - parent.absX, spawn.y - parent.absY, spawn.z - parent.absZ);
}
NPC npc;
try {
npc = DbManager.NPCQueries.ADD_NPC(npcWithoutID, isMob);