mudlet-map-renderer 0.0.22 → 0.0.24

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.0.24
2
+ - respect room weights
3
+ # 0.0.23
4
+ - do not draw path fragments no on the level of displayed area
5
+
1
6
  # 0.0.22
2
7
  - handle not existing paths
3
8
 
@@ -716,7 +716,7 @@ class Renderer {
716
716
  let group = new paper.Group();
717
717
  locations.forEach(id => {
718
718
  let room = this.area.getRoomById(id);
719
- if (!room) {
719
+ if (!room || room.z !== this.area.zIndex) {
720
720
  return
721
721
  }
722
722
  let startPoint = new paper.Point(room.x + this.roomFactor * 0.5, room.y + this.roomFactor * 0.5)
@@ -724,7 +724,7 @@ class Renderer {
724
724
  exits.forEach(exitRoomId => {
725
725
  if (locations.indexOf(exitRoomId) > -1) {
726
726
  let exitRoom = this.area.getRoomById(exitRoomId);
727
- if (!exitRoom) {
727
+ if (!exitRoom || exitRoom.z !== this.area.zIndex) {
728
728
  return
729
729
  }
730
730
  let endPoint = new paper.Point(exitRoom.x + this.roomFactor * 0.5, exitRoom.y + this.roomFactor * 0.5)
@@ -10,7 +10,7 @@ class PathFinder {
10
10
  constructor(reader) {
11
11
  this.route = new Graph();
12
12
  reader.getAreas().forEach(area => area.rooms.forEach(room => {
13
- let exits = Object.values(room.exits).concat(Object.values(room.specialExits)).map(item => [item, 1]);
13
+ let exits = Object.values(room.exits).concat(Object.values(room.specialExits)).map(item => [item, room.weight ?? 1]);
14
14
  this.route.addNode(room.id.toString(), Object.fromEntries(exits))
15
15
  }))
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mudlet-map-renderer",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "keywords": [
5
5
  "mudlet",
6
6
  "map",