PDA

View Full Version : Loot Bug! <-- Squash me!


ichijin
05-04-2006, 09:58 AM
Hey all, been going through this stupid loot bug lately. I have tried a great many things toying with this bug so far. It seems that the GetCharges() is always returning 0 (or something other than what it should be) which is why its always 1 when looting from your own corpse. I have completely modified inventory.cpp to not use const ItemInst, modified world.exe and zone.exe to use Inventory *m_inv instead of just Inv throughout the code (The sections that did work for looting and such had inv as a pointer).

Inventory.cpp:
MoveItemCharges() is the function that is the FINAL authority on what ammount of stack gets set into a previously stacked place OR an open slot. (I split the TryStacking into two functions to reflect this.)

AutoPutItemInInventory() is the other place (if TryStacking does not succeed, or item is not stacked) it moves to the end call of PutItemInInventory().

Patching charges like: (iteminst)->SetCharges(5); right before the final return on either of those functions will yeild ALL stacks that are greater than 1 to become 5 when looted from your corpse.

For some reason my Client is not logging properly. If one of you would be so kind as to log the value of inst->GetCharges() in those two functions, and let me know the results I would greatly appreciate it. I do not believe it is carrying those charges into the functions we are using them, or if it is, something else is going on that resets them. Lets get this one squashed guys!