Mek-Kamoses Spire Rotating vendors have a bug that exclude an item from their rotation (full explanation and code snippet included)

Basic Info:

Platform: All
Issue Type: Gameplay
Game Mode: All
Server Type: All
Map: All
Server Name: N/A
Mods: N/A

Bug Description:

There’s a bug in the code of the rotating vendors, which prevents them from ever offering up the very last item on their list.
Currently for the two weapon merchants at the Spire, these are the Axe of the Lion and Frostshot, as well as the Lotus Burner Guardian Torso and the Black Blood Skinning Knife for the other vendors

The reason for the bug is that when generating the random number to pick from the selection, the developer who made it intuitively accounted for the fact that array elements start at 0, by subtracting 1 from the amount of items offered to purchase… however they forgot that the function they’re using to generate the random number already accounts for this internally and it also subtracts 1 from the maximum value.

This results in 2 being subtracted instead of 1 and because of this the existence ot the last item on the list is always going to be ignored for each rotating vendor.

The solution would be to get rid of that encircled -1 node.

Bug Reproduction:

Go to the rotating merchants and notice that they never offer up the above mentioned items.


And here I was, thinking this exclusion was deliberate.

Yea, apparently a lot of people did :open_mouth: there are even youtube videos about it and whatnot lol.

1 Like

I updated a title so staff has a better chance of noticing it as it looked more like a “not a bug” and just someone complaining of missing their rotation and thinking it’s a bug :joy:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.