patrick-layden / HyperConomy

https://dev.bukkit.org/projects/hyperconomy
GNU General Public License v3.0
35 stars 24 forks source link

HyperAPI.getAvailableObjects looks wrong #144

Open Pingger opened 6 years ago

Pingger commented 6 years ago

https://github.com/RegalOwl/HyperConomy/blob/424200b94fd2fb57364a5f36e927ee040e2d480b/src/main/java/regalowl/hyperconomy/HyperAPI.java#L265 and https://github.com/RegalOwl/HyperConomy/blob/424200b94fd2fb57364a5f36e927ee040e2d480b/src/main/java/regalowl/hyperconomy/HyperAPI.java#L284

Seems to be using the wrong method for finding the available TradeObjects. My Guess: if (availableObjects.get(i).getStock() != -1) { should have been the correct access. Although I don't really see, what this loop should do, it does not work correctly in the current way. (TradeObject and int NEVER equal, so the return value is ALWAYS -1)