Skip to content

Commit

Permalink
add Blacklist Checking to the MapMarkers
Browse files Browse the repository at this point in the history
  • Loading branch information
FaiThiX committed Dec 15, 2024
1 parent f7efc3c commit 582b884
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/structures/MapMarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,17 @@ class MapMarkers {
return remainingMarkersOfType;
}



isVendingMachineBlacklisted(marker) {
if (marker.type !== this.types.VendingMachine) return false;

const instance = this.client.getInstance(this.rustplus.guildId);
const marketBlacklist = instance.marketBlacklist;

return marketBlacklist.some(blacklist =>
marker.name.toLowerCase().includes(blacklist.toLowerCase())
);
}


/* Update event map markers */

Expand Down Expand Up @@ -310,7 +319,7 @@ class MapMarkers {

marker.location = pos;

if (!this.rustplus.isFirstPoll) {
if (!this.rustplus.isFirstPoll && !this.isVendingMachineBlacklisted(marker)) {
if (!this.knownVendingMachines.some(e => e.x === marker.x && e.y === marker.y)) {
this.rustplus.sendEvent(
this.rustplus.notificationSettings.vendingMachineDetectedSetting,
Expand Down

0 comments on commit 582b884

Please sign in to comment.