Denis 1474 Posted August 29, 2014 Share Posted August 29, 2014 Hello community, Bug: http://metin2dev.org/board/topic/2640-belt-inventory-bug/ The title says everything ^^ Open input_main.cpp and find this: if (!ch->IsEmptyItemGrid(p->ItemPos, pkItem->GetSize())) return; Under that add this code: for (WORD belt_index = BELT_INVENTORY_SLOT_START; belt_index < BELT_INVENTORY_SLOT_END; ++belt_index) { if (pkItem->GetType() != 3 && p->ItemPos.cell == belt_index) { if(pkItem->GetSubType() != 0 || pkItem->GetSubType() != 11 || pkItem->GetSubType() != 7) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ΐΜ ΎΖΐΜΕΫΐΊ Ί§Ζ® ΐΞΊ¥ΕδΈ®·Ξ ΏΕ±ζ Όφ Ύψ½ΐ΄Ο΄Ω.")); return; } } } I don't know if it is the best fix but it does its job. 17 Link to comment Share on other sites More sharing options...
Morphe 159 Posted August 29, 2014 Share Posted August 29, 2014 Thanks Denis! 1 Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4879 Posted August 29, 2014 Bot Share Posted August 29, 2014 please always add a description of what the bugs is. If there are multiple bugs in the code noone will know what this thread is about without checking the code. Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 29, 2014 Author Share Posted August 29, 2014 please always add a description of what the bugs is. If there are multiple bugs in the code noone will know what this thread is about without checking the code. My fault, I forgot to add the link of the topic with the bug 2 Link to comment Share on other sites More sharing options...
CiocoBoco 13 Posted August 29, 2014 Share Posted August 29, 2014 Thanks @Denis !!! 1 Link to comment Share on other sites More sharing options...
Endymion 320 Posted August 29, 2014 Share Posted August 29, 2014 input_main.cpp Add this include: #include "belt_inventory_helper.h" And past this if (p->ItemPos.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(pkItem)) { ch->ChatPacket(CHAT_TYPE_INFO, "<Belt> Ops."); return; } under LPITEM pkItem = pkSafebox->Get(p->bSafePos); In CInputMain::SafeboxCheckout ©Terenzo. 4 Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 29, 2014 Author Share Posted August 29, 2014 input_main.cpp Add this include: #include "belt_inventory_helper.h" And past this if (p->ItemPos.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(pkItem)) { ch->ChatPacket(CHAT_TYPE_INFO, "<Belt> Ops."); return; } under LPITEM pkItem = pkSafebox->Get(p->bSafePos); In CInputMain::SafeboxCheckout ©Terenzo. Didn't thought about that 1 Link to comment Share on other sites More sharing options...
TheSLZ 105 Posted August 30, 2014 Share Posted August 30, 2014 Thx for the fix. This fix for item_shop storage too? Link to comment Share on other sites More sharing options...
HITRON 694 Posted August 30, 2014 Share Posted August 30, 2014 Thx for the fix. This fix for item_shop storage too? Yes. Link to comment Share on other sites More sharing options...
cBaraN 109 Posted August 30, 2014 Share Posted August 30, 2014 Thanks @Denis Link to comment Share on other sites More sharing options...
Denis 1474 Posted September 15, 2014 Author Share Posted September 15, 2014 New bug: Bug 1(char_item.cpp): If you're using 4 inventory page you can't move items to the last 2 positions at belt inventory (256,257).You need to change byte to int but I didn't find where to change it so I fix it with and ugly way. Find this: if (DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ΐΜ ΎΖΐΜΕΫΐΊ Ί§Ζ® ΐΞΊ¥ΕδΈ®·Ξ ΏΕ±ζ Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } And under that add this: if(DestCell.cell >= 256 && DestCell.window_type == INVENTORY) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BELT_255_256")); return false; } Bug 2(char_item.cpp): When you have items at belt inventory and you click at another belt they change.(I can't explain it very well ^^) Find this: bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell) { And under that paste this: LPITEM belt1,belt2; Find this: int iWearCell = item->FindEquipCell(this, iCandidateCell); Under that paste this: TItemPos srcCell(INVENTORY, item->GetCell()), destCell(INVENTORY, INVENTORY_MAX_NUM + iWearCell); Now find this: if (item->GetWearFlag() == WEARABLE_ABILITY) return false; And under that paste this: if (srcCell.IsEquipPosition()) { belt1 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); belt2 = GetInventoryItem(item->GetCell()); } else { belt1 = GetInventoryItem(item->GetCell()); belt2 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); } if ((ITEM_BELT == belt2->GetType()) && (CBeltInventoryHelper::IsExistItemInBeltInventory(this) == true)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ί§Ζ® ΐΞΊ¥ΕδΈ®Ώ΅ ΎΖΐΜΕΫΐΜ ΑΈΐηΗΟΈι ΗΨΑ¦Η Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } 4 Link to comment Share on other sites More sharing options...
TheSLZ 105 Posted September 15, 2014 Share Posted September 15, 2014 If you're using 4 inventory page you can't move items to the last 2 positions at belt inventory (256,257).You need to change byte to int but I didn't find where to change it so I fix it with and ugly way. char_item.cpp BYTE bCell = Cell.cell; to int bCell = Cell.cell; But its's not enogugh, We still have quickslot bug. (Need to find another byte, maybe clientside) When move items to the last 2 positions at belt inventory to quickslot, not the potions appear. Vid: When you have items at belt inventory and you click at another belt they change.(I can't explain it very well ^^) This caused by this: http://metin2dev.org/board/topic/1849-cfix-change-equipment-with-full-inventory/ But already fixed: http://metin2dev.org/board/topic/2932-bug-with-belts/?p=19528 Link to comment Share on other sites More sharing options...
SeXpL0SiVe 4 Posted October 26, 2015 Share Posted October 26, 2015 New bug: Bug 1(char_item.cpp): If you're using 4 inventory page you can't move items to the last 2 positions at belt inventory (256,257).You need to change byte to int but I didn't find where to change it so I fix it with and ugly way. Find this: if (DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ΐΜ ΎΖΐΜΕΫΐΊ Ί§Ζ® ΐΞΊ¥ΕδΈ®·Ξ ΏΕ±ζ Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } And under that add this: if(DestCell.cell >= 256 && DestCell.window_type == INVENTORY) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BELT_255_256")); return false; } Bug 2(char_item.cpp): When you have items at belt inventory and you click at another belt they change.(I can't explain it very well ^^) Find this: bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell) { And under that paste this: LPITEM belt1,belt2; Find this: int iWearCell = item->FindEquipCell(this, iCandidateCell); Under that paste this: TItemPos srcCell(INVENTORY, item->GetCell()), destCell(INVENTORY, INVENTORY_MAX_NUM + iWearCell); Now find this: if (item->GetWearFlag() == WEARABLE_ABILITY) return false; And under that paste this: if (srcCell.IsEquipPosition()) { belt1 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); belt2 = GetInventoryItem(item->GetCell()); } else { belt1 = GetInventoryItem(item->GetCell()); belt2 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); } if ((ITEM_BELT == belt2->GetType()) && (CBeltInventoryHelper::IsExistItemInBeltInventory(this) == true)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ί§Ζ® ΐΞΊ¥ΕδΈ®Ώ΅ ΎΖΐΜΕΫΐΜ ΑΈΐηΗΟΈι ΗΨΑ¦Η Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } i did that and all i made was to "freeze" the belt ;p could not remove or switch belts and could not remove pots or change their slots New bug: Bug 1(char_item.cpp): If you're using 4 inventory page you can't move items to the last 2 positions at belt inventory (256,257).You need to change byte to int but I didn't find where to change it so I fix it with and ugly way. Find this: if (DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ΐΜ ΎΖΐΜΕΫΐΊ Ί§Ζ® ΐΞΊ¥ΕδΈ®·Ξ ΏΕ±ζ Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } And under that add this: if(DestCell.cell >= 256 && DestCell.window_type == INVENTORY) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BELT_255_256")); return false; } Bug 2(char_item.cpp): When you have items at belt inventory and you click at another belt they change.(I can't explain it very well ^^) Find this: bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell) { And under that paste this: LPITEM belt1,belt2; Find this: int iWearCell = item->FindEquipCell(this, iCandidateCell); Under that paste this: TItemPos srcCell(INVENTORY, item->GetCell()), destCell(INVENTORY, INVENTORY_MAX_NUM + iWearCell); Now find this: if (item->GetWearFlag() == WEARABLE_ABILITY) return false; And under that paste this: if (srcCell.IsEquipPosition()) { belt1 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); belt2 = GetInventoryItem(item->GetCell()); } else { belt1 = GetInventoryItem(item->GetCell()); belt2 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); } if ((ITEM_BELT == belt2->GetType()) && (CBeltInventoryHelper::IsExistItemInBeltInventory(this) == true)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ί§Ζ® ΐΞΊ¥ΕδΈ®Ώ΅ ΎΖΐΜΕΫΐΜ ΑΈΐηΗΟΈι ΗΨΑ¦Η Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } i did that and all i made was to "freeze" the belt ;p could not remove or switch belts and could not remove pots or change their slots I WAS WRONG :ppp. It works i just removed the return false; from the if (item->GetWearFlag() == WEARABLE_ABILITY) but i got it back and it works PERFECTLY fine im posting this for you to see it if u r about to make the same mistake the if (srcCell.IsEquipPosition()) { belt1 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); belt2 = GetInventoryItem(item->GetCell()); } else { belt1 = GetInventoryItem(item->GetCell()); belt2 = GetInventoryItem(INVENTORY_MAX_NUM + iWearCell); } if ((ITEM_BELT == belt2->GetType()) && (CBeltInventoryHelper::IsExistItemInBeltInventory(this) == true)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ί§Ζ® ΐΞΊ¥ΕδΈ®Ώ΅ ΎΖΐΜΕΫΐΜ ΑΈΐηΗΟΈι ΗΨΑ¦Η Όφ Ύψ½ΐ΄Ο΄Ω.")); return false; } goes under the return false; and does not replace it thank you @Denis Link to comment Share on other sites More sharing options...
Yasin Sarıoğlu 0 Posted April 5, 2016 Share Posted April 5, 2016 Thanks you @Denis Link to comment Share on other sites More sharing options...
Aioria 10 Posted November 15, 2016 Share Posted November 15, 2016 which bug? link is dead Link to comment Share on other sites More sharing options...
Recommended Posts