Skip to content

Commit

Permalink
fix(ge): avoid duplicate partial trade notifications (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy authored Aug 10, 2023
1 parent 6825396 commit f0cae07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Unreleased

- Bugfix: Avoid duplicate grand exchange notifications for partial transactions at trade limit.

## 1.6.1

- Minor: Include new pet names from Desert Treasure II bosses in notification metadata. (#279)
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/dinkplugin/notifiers/GrandExchangeNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ private boolean shouldNotify(int slot, GrandExchangeOffer offer) {
if (spacing < 0)
return false; // negative => no in-progress notifications allowed

if (getSavedOffer(slot).filter(saved -> saved.equals(offer)).isPresent())
return false; // ignore since quantity already observed (relevant when trade limit is binding)

// convert minutes to seconds, but treat 0 minutes as 2 seconds to workaround duplicate RL events
long spacingSeconds = spacing > 0 ? spacing * 60L : 2L;

Expand Down

0 comments on commit f0cae07

Please sign in to comment.