|
|
|
@ -541,18 +541,8 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
mobWithoutID.parentZone = parent; |
|
|
|
mobWithoutID.parentZone = parent; |
|
|
|
mobWithoutID.parentZoneID = parent.getObjectUUID(); |
|
|
|
mobWithoutID.parentZoneID = parent.getObjectUUID(); |
|
|
|
|
|
|
|
|
|
|
|
// Ensure spawn coordinates are persisted for DB insert
|
|
|
|
|
|
|
|
// statLat/statAlt/statLon represent local (zone-relative) spawn
|
|
|
|
|
|
|
|
// coordinates used by the DB handler when creating the mob row.
|
|
|
|
|
|
|
|
if (spawn != null && parent != null) { |
|
|
|
|
|
|
|
// Convert world coordinates to zone-local spawn coordinates
|
|
|
|
|
|
|
|
Vector3fImmutable localSpawn = spawn.subtract(parent.getLoc()); |
|
|
|
|
|
|
|
mobWithoutID.statLat = localSpawn.x; |
|
|
|
|
|
|
|
mobWithoutID.statAlt = localSpawn.y; |
|
|
|
|
|
|
|
mobWithoutID.statLon = localSpawn.z; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NPC in a Building derives position from slot
|
|
|
|
// NPC in a Building derives position from slot
|
|
|
|
|
|
|
|
|
|
|
|
if (mobWithoutID.building != null) |
|
|
|
if (mobWithoutID.building != null) |
|
|
|
mobWithoutID.bindLoc = Vector3fImmutable.ZERO; |
|
|
|
mobWithoutID.bindLoc = Vector3fImmutable.ZERO; |
|
|
|
|
|
|
|
|
|
|
|
|