Hello! First of all, thank you for the great plugin. I'm using it on an active server, but we are currently experiencing a massive console spam issue related to the Buy/Sell Offers UI, which is causing performance drops.
Here is the exact error spamming our console:
Plaintext
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
And the Oxide debug log points directly to this method:
Plaintext
Failed to call hook 'ShoppyStockConsoleCommand' on plugin 'ShoppyStock v2.1.4' (IndexOutOfRangeException: Index was outside the bounds of the array.) at Oxide.Plugins.ShoppyStock.UpdateBuySellOfferDetailsUI (BasePlayer player, System.Int32 newIndex) [0x00236] at Oxide.Plugins.ShoppyStock.ShoppyStockConsoleCommand (ConsoleSystem+Arg arg)
Context: This seems to trigger when players are interacting with the stock market UI (specifically checking buy/sell offer details). It looks like newIndex is falling out of bounds—possibly when an offer is purchased/removed while someone else is viewing it, or if they click through the UI too quickly.
Could you please add a quick bounds check (e.g., if (newIndex < 0 || newIndex >= list.Count) return;) inside the UpdateBuySellOfferDetailsUI method in the next update to prevent this error loop?
Thanks for your time and for the awesome work!