Edit- Found an easy fix for the problem. Edited code below on the off chance anyone else ever has this problem. (Second socket glitch)
I've been working on an old private server source (I believe its Impulses) mostly for my own programming experience. I've been able to work around or fix every glitch I've run into but there's one thing I haven't been able to figure out how to fix.
When you put a 2 socket item in Phoenix Castle gem socket screen and remove it the 2 slots stay on the GUI and you can replace it with a 1 sock item and make it 2 sock.
This is the code that came with the source regarding socketing. Can anyone point me in the direction of where to add a check for the socket actually being in the item or possibly how to make the item not removable from the GUI to start with?
case 1027:
{
uint MainUID = BitConverter.ToUInt32(Data, 8);
uint GemUID = BitConverter.ToUInt32(Data, 12);
Game.Item MainItem = GC.MyChar.FindInvItem(MainUID);
Game.Item Gem = GC.MyChar.FindInvItem(GemUID);
byte Mode = Data[18];
byte Slot = Data[16];
if (Mode == 0)
{
GC.MyChar.RemoveItem(MainItem);
GC.MyChar.RemoveItem(Gem);
if (Slot == 1 && MainItem.Soc1 != NewestCOServer.Game.Item.Gem.NoSocket)
MainItem.Soc1 = (Game.Item.Gem)(Gem.ID - 700000);
if (Slot == 2 && MainItem.Soc2 != NewestCOServer.Game.Item.Gem.NoSocket)
MainItem.Soc2 = (Game.Item.Gem)(Gem.ID - 700000);
GC.MyChar.AddItem(MainItem);
}
else
{
GC.MyChar.RemoveItem(MainItem);
if (Slot == 1 && MainItem.Soc1 != NewestCOServer.Game.Item.Gem.NoSocket)
MainItem.Soc1 = Game.Item.Gem.EmptySocket;
if (Slot == 2 && MainItem.Soc2 != NewestCOServer.Game.Item.Gem.NoSocket)
MainItem.Soc2 = Game.Item.Gem.EmptySocket;
GC.MyChar.AddItem(MainItem);
}
break;
}