Treasure Generator gives duplicate items

Issue #87 resolved
Former user created an issue

Treasure generator gives duplicates when you have less item types chosen than items to be generated.

Bug found on Google Chrome on iPad 3 on current iOS as of 2016-06-30.

Screenshot of only 1 item type and 5 items: https://www.dropbox.com/s/d1275y4hwghs6f6/2016-07-02%2011.20.22.png?dl=0

Comments (6)

  1. Brian Thomas

    I cannot replicate this; I tried generating 5 items of one itemtype (as well as NOT setting an item type) and each time (4 tries) it always gave me what I wanted.

  2. Travis Ellis

    Replication steps:

    Pick Rare Artifacts as the single category of item you want to generate

    Generate 5+ items Watch repeats flow in

  3. Brian Thomas

    I just tried in both firefox and chrome, following the above directions, still can't replicate this on my desktop (dont have an ipad). I've also tried the underlying service and looked at the logs. I don't see anything. My feeling/guess at this point is that its probably an issue with the GURPS Calculator caching the first result somehow in the client javascript. The JS engine I have doesnt appear to show the issue.

  4. Jeff Demers

    This is happening because when you select to generate "x items" from the list it rolls once randomly for the entire list, chooses a treasure type, and then rolls randomly for that treasure type. What's happening here is you've picked just "rare artifacts" so it "rolls" for type, gets rare artifact, and then rolls for the item. It then does this four more times. Because it's not rolling 5 times all at once, it's possible to get dupes.

    I added code to check if there is only one type selected and if there is, instead of rolling each individually, it rolls them all at once as though you had turned on "individual" type rolling in the options.

    This will be live with the next release.

  5. Log in to comment