Skip to content

Commit

Permalink
Actually fix the missing_locations bug this time. (#143)
Browse files Browse the repository at this point in the history
Actually fix the bug this time.
  • Loading branch information
ThePhar committed Apr 10, 2023
1 parent a33a225 commit d7941c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "archipelago.js",
"version": "0.5.1",
"version": "0.5.2",
"description": "A general-purpose client library for communicating with Archipelago game servers, written for Node.js.",
"license": "MIT",
"main": "dist/index.js",
Expand Down
19 changes: 7 additions & 12 deletions src/managers/LocationsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,16 @@ export class LocationsManager {
// Update our checked/missing arrays.
if (packet.checked_locations) {
for (const location of packet.checked_locations) {
if (!this._checked.includes(location)) this._checked.push(location);
if (!this._checked.includes(location)) {
this._checked.push(location);

// Remove from missing locations array as well.
const index = this._missing.indexOf(location);
if (index !== -1) {
this._missing = this._missing.splice(index, 1);
// Remove from missing locations array as well.
const index = this._missing.indexOf(location);
if (index !== -1) {
this._missing.splice(index, 1);
}
}
}
}

// TODO: Does AP actually send missing locations?
if (packet.missing_locations) {
for (const location of packet.missing_locations) {
this._missing.filter((missing) => missing !== location);
}
}
}
}

0 comments on commit d7941c3

Please sign in to comment.