Spodii / netgore

Cross platform online rpg engine using C# and SFML
http://www.netgore.com/
40 stars 16 forks source link

Shops not correctly "vending" #310

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
More details to come when i can get my ide to work again.  So far

Buying items from a shop, in top down at least does not actually appear add to 
inventory in database.

When a stack limit is reached for an item you can continually buy them with no 
apparent difference to your inventory.

Original issue reported on code.google.com by aphro.cag on 2 Apr 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Update:

Shops do not function correctly when buying new items.

Buying an item you do not already hold fails.
Buying an item you do already hold results in the following scenario:

First buy of item -> You automatically receive one item;
Second buy of item -> You automatically recieve two items; And so on and so on.

These appear to persist in the database as fas as I can tell.

I think these are the Major issues here, however I am pretty certain that 
InventoryBase.TryInternalAdd() is NOT the culprit as i first suspected as 
Character.GiveItem() functions correctly when picking items off the ground, 
i've got a horrible feeling some reference types are being lost.

Original comment by aphro.cag on 3 Apr 2011 at 3:22

GoogleCodeExporter commented 9 years ago
Finally getting somewhere if not slowly.

The problem is not in the logic of the InventoryBase.TryInternalAdd() which i 
checked first,  however it appears to be being called by the message processor 
more than once.  Got to find the reason for this i have.

Original comment by aphro.cag on 3 Apr 2011 at 4:38

GoogleCodeExporter commented 9 years ago
r4501 fixes these issues.

Original comment by aphro.cag on 3 Apr 2011 at 4:56