When it mentions charges in those cases, it is referring to how many are in the stack. Sometimes the word charges gets used for both stacksize and actual charges on an item. In the case of stackable items, it sees them as charges.
As for the disappearing items issue, it sounds like there are still some problems with the slot conversions between Titanium and SoF. The change of slot numbers between the 2 clients has been one of the biggest pains to getting all of the item related packets working properly. This is not an opcode issue, as opcodes are simply a way of identifying the type of packet being sent and we have most of those identified properly. It also shouldn't be related to packet structures. The problem is that with any case that involves items slots, we have to do a conversion of the slot id so that Titanium and SoF slots are compatible. Really, this is a bit of a pain, because SoF has more slots than Titanium does, so converting them causes a few issues, especially due to the addition of the new Power Source slot which took the place of the Ammo slot id and bumped up all of the normal inventory slots as well.
I think what needs to be done is that we need to put in some type of conversion function that accounts for all slots between each expansion as noted in the slot list here:
http://www.eqemulator.net/wiki/wikka...InventorySlots
I believe we have all possible slots identified other than maybe merchant slots. Even corpse looting slots got adjusted, but I should already have the encode set to account for that change properly.
It would be easy for me to write up the actual conversion for each slot, but I am not sure of the best way to utilize it in each encode yet. Maybe a function named TitaniumToSoFSlot() and another named SoFtoTitaniumSlot() or something could be made and used to convert each slot. I am not sure of where the best place to put that is, other than maybe directly in SoF.cpp, since that is probably the only place that it would get used.
Then, an encode could be done like this:
Code:
ENCODE(OP_DeleteCharge) { ENCODE_FORWARD(OP_MoveItem); }
ENCODE(OP_MoveItem) {
ENCODE_LENGTH_EXACT(MoveItem_Struct);
SETUP_DIRECT_ENCODE(MoveItem_Struct, structs::MoveItem_Struct);
eq->from_slot = TitaniumToSoFSlot(emu->from_slot);
eq->to_slot = TitaniumToSoFSlot(emu->to_slot);
OUT(number_in_stack);
FINISH_ENCODE();
}
Instead of doing this, which is what we current have to do and is sloppy:
Code:
ENCODE(OP_DeleteCharge) { ENCODE_FORWARD(OP_MoveItem); }
ENCODE(OP_MoveItem) {
ENCODE_LENGTH_EXACT(MoveItem_Struct);
SETUP_DIRECT_ENCODE(MoveItem_Struct, structs::MoveItem_Struct);
if(emu->from_slot >= 21 && emu->from_slot < 50)
{
eq->from_slot = emu->from_slot + 1;
}
else if(emu->from_slot >= 251 && emu->from_slot < 351)
{
eq->from_slot = emu->from_slot + 11;
}
else if(emu->from_slot >= 2031 && emu->from_slot < 2270)
{
eq->from_slot = emu->from_slot + 1;
}
else if(emu->from_slot >= 2531 && emu->from_slot < 2550)
{
eq->from_slot = emu->from_slot + 1;
}
else
{
OUT(from_slot);
}
if(emu->to_slot >= 21 && emu->to_slot < 50)
{
eq->to_slot = emu->to_slot + 1;
}
else if(emu->to_slot >= 251 && emu->to_slot < 351)
{
eq->to_slot = emu->to_slot + 11;
}
else if(emu->to_slot >= 2031 && emu->to_slot < 2270)
{
eq->to_slot = emu->to_slot + 1;
}
else if(emu->to_slot >= 2531 && emu->to_slot < 2550)
{
eq->to_slot = emu->to_slot + 1;
}
else
{
OUT(to_slot);
}
OUT(number_in_stack);
FINISH_ENCODE();
}
We have far too many encodes using the long way of doing this and it is almost certain that there are mistakes in some of them. By having a function to handle the conversion, we would just need to make sure that the function worked perfectly, and once it did, everything else using it will as well.
I might look into adding this tonight, but any input from the other devs would be nice. I am not exactly sure of the best spot to implement this or what the best way to use it would be. Should be fairly straight-forward, but I won't know until I try it, I guess.
Also, using this option, it should make it easier for us to pick an unused Titanium slot that we can use to store the Power Source slot as so it can be used for SoF and automatically converted back and forth without having to alter every encode/decode for slots.