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