Skip to content

Commit c1ac0be

Browse files
committed
Work around issue #21
1 parent 9543870 commit c1ac0be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/from-minimap.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ const parseMarkerData = (buffer) => {
8989
marker.description = utf8.decode(
9090
descriptionBuffer.toString('binary')
9191
);
92-
// The byte sequence 0x20 0x00 marks the end of the marker.
93-
console.assert(buffer[index++] === 0x20);
94-
console.assert(buffer[index++] === 0x00);
92+
// The next few bytes are usually 0x20 0x00, marking the end of the marker.
93+
// However, there are cases where the client produces a different format
94+
// for reasons unknown.
95+
// https://github.com/tibiamaps/tibia-maps-script/issues/21
96+
while (buffer[index] !== undefined && buffer[index] !== 0x0A) index++;
9597

9698
// Create a sorted-by-key version of the marker object.
9799
const sorted = {

0 commit comments

Comments
 (0)