Bug - Fixed inventory desync when using create() to use the nash crosby still

taltamir

Member
when using the create() command to distill an item in the nash crosby still it causes an inventory desync

a simple while loop trying to make multiple tonic waters gets an error due to the inventory desync

Code:
buy 1 soda water for 66 each from The General Store
You spent 66 Meat
You acquire an item: soda water
> [DEBUG] distill(item target) called to create [tonic water]
You acquire an item: tonic water
> [DEBUG] distill(item target) called to create [tonic water]
Stack trace:

modify the code to perform a
cli_execute("refresh inv");
after every time create is called and it has no such issues
Code:
buy 1 soda water for 66 each from The General Store
You spent 66 Meat
You acquire an item: soda water
> [DEBUG] distill(item target) called to create [tonic water]
You acquire an item: tonic water

buy 1 soda water for 66 each from The General Store
You spent 66 Meat
You acquire an item: soda water
> [DEBUG] distill(item target) called to create [tonic water]
You acquire an item: tonic water

buy 1 soda water for 66 each from The General Store
You spent 66 Meat
You acquire an item: soda water
> [DEBUG] distill(item target) called to create [tonic water]
You acquire an item: tonic water

buy 1 soda water for 66 each from The General Store
You spent 66 Meat
You acquire an item: soda water
> [DEBUG] distill(item target) called to create [tonic water]
You acquire an item: tonic water

buy 1 soda water for 66 each from The General Store
You spent 66 Meat
You acquire an item: soda water
> [DEBUG] distill(item target) called to create [tonic water]
You acquire an item: tonic water
 

fronobulax

Developer
Staff member
r20865

I used the relay browser to purchase 5 soda water and then used the relay browser to use the still to make 5 tonic. At the completion of the tonics, I had stills left but no more tonic (as expected). I then went into Item Manager -> Usable -> restores and saw 5 soda water and 5 tonic water which seems to be an inventory refresh issue and provides an alternate way to duplicate.
 

beldur

New member
I want to piggyback on this issue because I think it could be closely related to something I'm experiencing. I've had some similar issues with the pixel store when accessed by create/create(). CLI tests are attached in a txt file to not clutter up the thread.

These are both stores accessed through create that accept multiple different items as currencies, I don't know which of these details are important.
 

Attachments

  • tests.txt
    2.3 KB · Views: 4

heeheehee

Developer
Staff member
Hm, I can reproduce the pixel thing. Fascinating.

That will probably help a lot with reproducing / debugging.
 

heeheehee

Developer
Staff member
Looks like a problem with NPCStoreDatabase.itemIdByRow( shopId, row ) returning -1.

I have a test that should reproduce; will continue tinkering.
 
Top