emanuel 18 Posted December 10, 2016 Share Posted December 10, 2016 (edited) Hello guys,i have a little bug(i think is bug) look to my gif immage,how can i solve this ? Thank you! Spoiler Edited September 3, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
emanuel 18 Posted December 11, 2016 Author Share Posted December 11, 2016 up,i pay for that Link to comment Share on other sites More sharing options...
Premium North 1173 Posted December 11, 2016 Premium Share Posted December 11, 2016 Paste the code in the source that affects the position of the item when you swap, seems like it has a +1 position when he swaps you just have to delete that Link to comment Share on other sites More sharing options...
emanuel 18 Posted December 11, 2016 Author Share Posted December 11, 2016 Here is for char_item.cpp : //search if (!IsEmptyItemGrid(DestCell, item->GetSize(), Cell.cell)) return false; //change with: if (!IsEmptyItemGrid(DestCell, item->GetSize(), Cell.cell)) { if (!SwapItemToItem(Cell, DestCell)) return false; else return true; } //after last bool you put this: bool CHARACTER::SwapItemToItem(TItemPos srcCell, TItemPos destCell) { if (!CanHandleItem()) return false; BYTE bCell = srcCell.cell; BYTE bDestCell = destCell.cell; BYTE pages_count = 4; if (srcCell.IsDragonSoulEquipPosition() || destCell.IsDragonSoulEquipPosition()) return false; if (bCell == bDestCell) return false; if (srcCell.IsEquipPosition() || destCell.IsEquipPosition()) return false; if (srcCell.window_type != INVENTORY || destCell.window_type != INVENTORY || destCell.cell >= INVENTORY_MAX_NUM) return false; LPITEM item1, item2; item1 = GetInventoryItem(bCell); item2 = GetInventoryItem(bDestCell); if (!item1 || !item2) return false; if (item1 == item2) { sys_log(0, "[WARNING][WARNING][HACK USER!] : %s %d %d", m_stName.c_str(), bCell, bDestCell); return false; } if (item1->GetSize() == item2->GetSize()) { BYTE bCell1 = item1->GetCell(); BYTE bCell2 = item2->GetCell(); item1->RemoveFromCharacter(); item2->RemoveFromCharacter(); item1->AddToCharacter(this, TItemPos(INVENTORY, bCell2)); item2->AddToCharacter(this, TItemPos(INVENTORY, bCell1)); } if (item1->GetSize() > item2->GetSize()) { BYTE bCell1 = item1->GetCell(); ChatPacket(CHAT_TYPE_INFO, "Slot %d", bDestCell); BYTE pPageDest = bDestCell / (INVENTORY_MAX_NUM / pages_count); BYTE pPageDest2 = (((item1->GetSize()-1) * 5) + bDestCell) / (INVENTORY_MAX_NUM / pages_count); if (bDestCell >= INVENTORY_MAX_NUM) return false; if (pPageDest != pPageDest2) { for (int ii = 1; ii < 4; ++ii) { pPageDest2 = (bDestCell + (5*(item1->GetSize()-1)) - (5 * ii)) / (INVENTORY_MAX_NUM / pages_count); if (pPageDest == pPageDest2) { bDestCell = bDestCell - (5 * ii); break; } } } if (pPageDest != pPageDest2) return false; item1->RemoveFromCharacter(); for (int i = 0; i < item1->GetSize(); ++i) { BYTE bBusyCell = bDestCell + (5 * i); BYTE lpage = bBusyCell / (INVENTORY_MAX_NUM / pages_count); if (lpage != pPageDest) continue; TItemPos busyCell(INVENTORY, bBusyCell); LPITEM busy = GetItem(busyCell); if (busy) { busy->RemoveFromCharacter(); busy->AddToCharacter(this, TItemPos(INVENTORY, bCell1 + (5 * i))); } } item1->AddToCharacter(this, TItemPos(INVENTORY, bDestCell)); } return true; } Link to comment Share on other sites More sharing options...
metin2-factory 1010 Posted December 12, 2016 Share Posted December 12, 2016 Does it happen only with you move an item that its size is 3 slots?(like the weapon you show). If so, try the following: look for if (busy) { busy->RemoveFromCharacter(); busy->AddToCharacter(this, TItemPos(INVENTORY, bCell1 + (5 * i))); } } add below (if item1->GetSize() == 3) bDestCell -= 5; 1 Link to comment Share on other sites More sharing options...
emanuel 18 Posted December 12, 2016 Author Share Posted December 12, 2016 Yes , just if i move item size with 3 slots,i will try now,thank you for your time dude! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now