Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2009, 10:11 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

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);
and delete the last 2 args so it looks like:
Code:
client->DeleteItemInInventory(interior_slot);
and the same for the one a couple of lines below it find:
Code:
client->DeleteItemInInventory(equipslot, item->GetCharges(), false);
change to:
Code:
client->DeleteItemInInventory(equipslot);
Reply With Quote
  #2  
Old 01-16-2009, 12:24 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

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.
Reply With Quote
  #3  
Old 01-16-2009, 01:21 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

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) {
and replace with:
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()) {
			if(item_data) 
				//Restore charges from the original item.
				inst->SetCharges(item_data->charges);
			else
				inst->SetCharges(1);
		} else {
			//default changes
			if(item->MaxCharges == -1)
				inst->SetCharges(1);
			else
				inst->SetCharges(item->MaxCharges);
		}
and replace with:
Code:
		if(inst->IsStackable()) {
			if(item_data) 
				//Restore charges from the original item.
				inst->SetCharges(item_data->charges);
			else
				inst->SetCharges(1);
		} else {
			//default changes
			if(item->MaxCharges == -1)
				inst->SetCharges(1);
			else {
				if(item_data) {
					//Restore charges from the original item.
					inst->SetCharges(item_data->charges);
				}
				else {
					inst->SetCharges(item->MaxCharges);
				}
			}
		}
Reply With Quote
  #4  
Old 01-19-2009, 12:31 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This has been on PEQ for a bit now with no ill effects reported. It works like a charm. I say commit it.
Reply With Quote
  #5  
Old 01-19-2009, 01:12 AM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Thanks for testing this on your server Cavedude. Committed in SVN 278.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:26 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3