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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-09-2011, 02:08 PM
l0stmancd
Fire Beetle
 
Join Date: Apr 2005
Posts: 23
Default COMMITTED: Augmentation Inventory Container - Fix lag lore item deletion defect.

There is an issue with the augmentation inventory container where a small amount of lag between when the items are pushed onto the cursor and the old-items are deleted from the inventory could cause the client to delete the inventory item causing lore item collision. This will cause the new item that should have been pushed onto your cursor to disappear until you zone or camp.

The code change is minor - it will keep track of the items that you were pushing onto the cursor and instead hold these until the item deletion has occurred.

The only interesting part of the code is in the ->Clone() call that had to be added. If we do not add this then we would be trying to push down an item to the client that was already deleted in the above section - causes obvious issues.

Testing the following with SoD and Titanium:
Augments can be removed from an item and both augment/item are pushed onto cursor.
Augments can be put onto an item and the new item is pushed onto the cursor.
No older augments are modified / removed as part of this unless they were chosen to be removed.

Tested with the following item ids:
82363
69312
60332
47013

Code:
Index: tradeskills.cpp
===================================================================
--- tradeskills.cpp	(revision 1806)
+++ tradeskills.cpp	(working copy)
@@ -108,11 +108,13 @@
 
 	bool deleteItems = false;
 
+	ItemInst *itemOneToPush = NULL, *itemTwoToPush = NULL;
+
 	// Adding augment
 	if (in_augment->augment_slot == -1) {
 		if (((slot=tobe_auged->AvailableAugmentSlot(auged_with->GetAugmentType()))!=-1) && (tobe_auged->AvailableWearSlot(auged_with->GetItem()->Slots))) {
 			tobe_auged->PutAugment(slot,*auged_with);
-			user->PushItemOnCursor(*tobe_auged,true);
+			itemOneToPush = tobe_auged->Clone();
 			deleteItems = true;
 		} else {
 			user->Message(13, "Error: No available slot for augment");
@@ -125,9 +127,9 @@
 		else
 			old_aug=tobe_auged->RemoveAugment(in_augment->augment_slot);
 
-		user->PushItemOnCursor(*tobe_auged,true);
+		itemOneToPush = tobe_auged->Clone();
 		if (old_aug)
-			user->PushItemOnCursor(*old_aug,true);
+			itemTwoToPush = old_aug->Clone();
 
 		deleteItems = true;
 	}
@@ -154,6 +156,14 @@
 			container->Clear();
 		}
 	}
+
+	// Must push items after the items in inventory are deleted - necessary due to lore items...
+	if (itemOneToPush) {
+		user->PushItemOnCursor(*itemOneToPush,true);
+	}
+	if (itemTwoToPush) {
+		user->PushItemOnCursor(*itemTwoToPush,true);
+	}
 }
 
 // Perform tradeskill combine
Reply With Quote
 


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 09:24 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3