Jump to content

How To Fix Belt Inventory


Denis

Recommended Posts

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.

  • Love 17
Link to comment
Share on other sites

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

  • Love 2
Link to comment
Share on other sites

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.

 

  • Love 4
Link to comment
Share on other sites

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 :D

  • Love 1
Link to comment
Share on other sites

  • 3 weeks later...

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;
			}
  • Love 4
Link to comment
Share on other sites

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

  • 1 year later...

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

  • 5 months later...
  • 7 months later...


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.