OpenNos Inventory Bug – Items Turn into Question Marks

03/14/2025 22:28 AnanasLOL#1
I am currently experiencing an issue with OpenNos related to inventory management and item movement. I am looking for insights into what might be causing this problem.

Problem 1: Question Marks Appearing After Moving Items
When moving an item within the Equipment Inventory, a question mark (?) appears in the slot where the item was previously located. This placeholder is not an actual item but remains in the inventory. If I move the item back to its original position, the question mark shifts to the previous slot. This occurs every time an item is moved.

Problem 2: Items Not Swapping Properly
Normally, swapping two items in the inventory should result in the following:

Item A moves to the slot of Item B
Item B moves to the slot of Item A
However, in my case, Item A simply overwrites Item B’s position, and Item B disappears from the inventory. The missing item only becomes visible again after relogging.

Possible Cause
I suspect the issue originates from my inventory handling logic. Below is the relevant code:

Quote:
public string GenerateInventoryRemove(InventoryType Type, short Slot)
=> $"ivn {(byte)Type} {GenerateRemovePacket(Slot)}";

public static string GenerateRemovePacket(short slot)
=> $"{slot}.-1.0.0.0";

public string GenerateInventoryAdd()
{
switch (Type)
{
case InventoryType.Equipment:
return $"ivn 0 {Slot}.{ItemVNum}.{Rare}.{(Item.IsColored ? Design : Upgrade)}.{SpStoneUpgrade}.{RuneAmount}";

case InventoryType.Main:
return $"ivn 1 {Slot}.{ItemVNum}.{Amount}.0";

case InventoryType.Etc:
return $"ivn 2 {Slot}.{ItemVNum}.{Amount}.0";

case InventoryType.Miniland:
return $"ivn 3 {Slot}.{ItemVNum}.{Amount}";

case InventoryType.Specialist:
return $"ivn 6 {Slot}.{ItemVNum}.{Rare}.{Upgrade}.{SpStoneUpgrade }";

case InventoryType.Costume:
return $"ivn 7 {Slot}.{ItemVNum}.{Rare}.{Upgrade}.0";
}
return "";
}
Packet Differences

Old Packets:

Quote:
ivn 0 42.-1.0.0.0
ivn 0 36.1.0.0.0.0
New Packets:

Quote:
ivn 0 42.0.0.0.0.0.0
ivn 0 36.1.0.0.0.0.0
Questions
Why does a question mark remain in the previous slot after moving an item?
Why does Item B disappear instead of swapping positions with Item A?


Any insights or suggestions regarding this issue would be greatly appreciated. If someone can help me here i m ready to pay for that :handsdown:
03/15/2025 19:14 XV50#2
You already sent the fix.


Code:
public static string GenerateRemovePacket(short slot)
=> $"{slot}.-1.0.0.0";
//replace -1 with 0 and add another 0

public static string GenerateRemovePacket(short slot) => string.Concat(slot, ".0.0.0.0.0");
In case you still have questions:
Discord: imaestos
03/16/2025 01:47 AnanasLOL#3
hey bro thank you it work for the first Problem :) but the second problem is still there ..

Problem 2: Items Not Swapping Properly