dredless 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11425,6 +11425,7 @@
11425
11425
  if (!Number.isFinite(limit) || limit < 0) return fallback;
11426
11426
  return Math.floor(limit);
11427
11427
  }
11428
+ var SAVE_ALLOWED_PARENT_WORLD_IDS = /* @__PURE__ */ new Set([66]);
11428
11429
  var DredlessClient = class _DredlessClient extends EventBus {
11429
11430
  constructor(connection, {
11430
11431
  connect = true,
@@ -11564,8 +11565,10 @@
11564
11565
  if (!this.connected || !this.ready) return false;
11565
11566
  const ship = this.worlds.shipWorld();
11566
11567
  if (!ship || ship.isOverworld !== false || ship.parentWorld == null) return false;
11567
- const parent = this.worlds.worlds.get(Number(ship.parentWorld));
11568
- return parent?.meta?.danger_level === 0;
11568
+ const parentId = Number(ship.parentWorld);
11569
+ if (SAVE_ALLOWED_PARENT_WORLD_IDS.has(parentId)) return true;
11570
+ const danger = this.worlds.worlds.get(parentId)?.meta?.danger_level;
11571
+ return danger == null || danger === 0;
11569
11572
  }
11570
11573
  async saveShip({ timeout = 1e4 } = {}) {
11571
11574
  this.#assertWritable();
@@ -11573,7 +11576,7 @@
11573
11576
  throw new RangeError("timeout must be positive milliseconds no greater than 2147483647");
11574
11577
  }
11575
11578
  if (this.#savePending) throw new Error("A ship save is already in progress");
11576
- if (!this.canSaveShip()) throw new Error("Saving requires a connected, ready client with its ship in a known Safe Zone");
11579
+ if (!this.canSaveShip()) throw new Error("Saving requires a connected, ready client with a current ship outside a known unsafe zone (Mosaic is allowed)");
11577
11580
  this.#savePending = true;
11578
11581
  try {
11579
11582
  return await new Promise((resolve, reject) => {