items disappearing after last charge is used - possible fix, test your items!
This is working for me using the Titanium client, but I read a post where KLS mentioned that the 0.6.2 client handles some things differently. Looking for testers!
\common\item.h existing: Code:
// Remove item from inventory Code:
// Remove item from inventory \common\Item.cpp replace method Inventory::DeleteItem(sint16 slot_id, uint8 quantity) with: Code:
// Remove item from inventory (with memory delete) \zone\inventory.cpp replace method Client::DeleteItemInInventory(sint16 slot_id, sint8 quantity, bool client_update) with: Code:
// Remove item from inventory |
This still needs some tweaking. Scribing spells is broke and it looks like trading is broke too, but hey... your items don't poof when you use the last charge! I've made a fix for the spell scribing and I'm working on the trading issue now.
|
Certain items don't deplete when used in tradeskills as well with this patch, one example is: http://lucy.allakhazam.com/item.html?id=27760 I also got a report that inventories didn't seem to be updating at all anymore.
Also, PEQ was getting this crash which is related to the above code: Code:
#0 Client::DeleteItemInInventory(short, signed char, bool) (this=0x85915e0, |
Thanks for testing this. Your crash looks like the spellbook scribing I mentioned above and I'll take a look into the tradeskill consumption.
|
Try this new code out. I've fixed the Spinechill Silk combine and the Spellbook Scribe crash.
If somebody could list some thing to test or items that currently go away when the charges are used but aren't supposed to, that would be great. Things I've tested with this new update: Tradeskills: Created Fish Rolls by combining 1 Fresh Fish and 1 Bat Wings. Stacked supplies correctly subtracted. Created Spinechill Silk by combining 1 Spinechill Ichor Vial and 2 Spinechill Silk. Unstackable supplies correctly subtracted. Worn items with charges: Cleric/Paladin Shield - Aegis of Life 1 charge of Superior Healing. Charge used, Item not deleted. Journeyman's Boots. Unlimited charges, not deleted. Inventory items with charges: Prayers of Life 5 charges of Word of Healing. Charges used, Item deleted. Crystalized Pumice 5 charges of Nullify Magic. Charges used, Item deleted. Stack of 10 Cloudy Potions. Stack decremented correctly and last one deleted. 5 Dose Cloudy Potion. Charges used, Item deleted. Stack of Bandages. Took some damage and used Bind Wound skill. Bandages decremented correctly. Spell Scribing: Wizard memorized Gate spell. Spell scroll deleted, no crash. Merchants: Purchased stackable items Purchased unstackable items Sold stackable items Sold unstackable items Bots: Trade with bots to give them equipment works. #bot inventory remove used successfully GM: #si [itemid] worked. #nukeitem [itemid] worked. You will still need the item.h and Item.cpp changes from the first post. This is the spell scribing fix: \zone\client_process.cpp void Client::OPMemorizeSpell(const EQApplicationPacket* app) Replace the case statement for memSpellScribing: Code:
case memSpellScribing: { // scribing spell to book Code:
case memSpellScribing: { // scribing spell to book Code:
// Remove item from inventory |
Found a new problem with the above code. Permanent items with charges do not delete off of player corpses. They remain on the player, AND also appear on the corpse. The charges of the items that remain on the player do seem to be depleted, as even unlimited items say the item is out of charges when used. Deleting those items, and looting the ones of their corpse works fine.
Edit: I should mention this bug only effects those who enable player corpses with items! |
Let me see if I understand this. A character dies, the item does correctly go to thier corpse with the correct charges, but a duplicate item with no charges stays with them including items normally with unlimited charges but they can loot multiple dupes off the corpse because '...do not delete off of player corpses'?
Can you tell me which item this is or is it any item with charges? I'll change my server rules to have corpses with items and check it out. |
That's correct. It's only been proven using items with unlimited charges. However, I would assume limited charged items also suffer from the same bug. Here are the items that were used:
http://lucy.allakhazam.com/item.html?id=26606 http://lucy.allakhazam.com/item.html?id=1113 http://lucy.allakhazam.com/item.html?id=28994 |
OK, I just tried it out and here is what I came up with:
I died with Aegis of Life (1 charge) being the only worn clicky item in my possession. I used the charge. When I zoned back in, the item was missing from my inventory, however the item on the corpse had gotten its charge back. I died with Talisman of the Burrower (unlimited charges) being the only worn clicky item in my possession. When I zoned back in, the item was both in my inventory and my corpse (duplicated.) However, both items worked normally, so at least that part of the above report was incorrect. I died with Aegis of Life (1 charge) and Talisman of the Burrower (unlimited charges) being the only worn clicky items in my possession. I used the charge on Aegis. When I zoned back in, BOTH items were duplicated on my corpse and inventory. Aegis of Life in my inventory still showed as the charge being used, however the one on the corpse once again had the charge replenished. I hope this helps some! Also, the Wee Harvester http://lucy.allakhazam.com/item.html?id=13980 is an example of a worn clicky with 20 charges that still deletes when the last charge is used, I remember from Live it should not do so. |
here's the fix for the charged item duping:
in PlayerCorpse.cpp find method: void Corpse::MoveItemToCorpse(Client *client, ItemInst *item, sint16 equipslot) then find: Code:
client->DeleteItemInInventory(interior_slot, interior_item->GetCharges(), false); Code:
client->DeleteItemInInventory(interior_slot); Code:
client->DeleteItemInInventory(equipslot, item->GetCharges(), false); Code:
client->DeleteItemInInventory(equipslot); |
I tested the recent changes briefly on my test server and all looked well. It'll go Live on PEQ with the reboot in the morning. Thanks for perfecting this! If all goes well tomorrow, might as well commit to SVN.
|
This fixes the Wee Harvester from poofing when the last charge is used:
Inventory.cpp find method: void Client::DeleteItemInInventory(sint16 slot_id, sint8 quantity, bool client_update) then find: Code:
if(m_inv[slot_id]->GetItem()->Click.Type == ET_EquipClick) { Code:
if((m_inv[slot_id]->GetItem()->Click.Type == ET_EquipClick) || (m_inv[slot_id]->IsWeapon())) { and this fixes the items that are getting recharged when looting from your corpse: PlayerCorpse.cpp find method: void Corpse::LootItem(Client* client, const EQApplicationPacket* app) then find: Code:
if(inst->IsStackable()) { Code:
if(inst->IsStackable()) { |
This has been on PEQ for a bit now with no ill effects reported. It works like a charm. :) I say commit it.
|
Thanks for testing this on your server Cavedude. Committed in SVN 278.
|
All times are GMT -4. The time now is 10:55 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.