Jump to content

Recommended Posts

Hello guys,

I added a weapon costume system and i have a visual bug. You can't unequip a weapon when you have a skin but you still can move it to the storekeeper and the skin remains until you relog. Its just visual but it is wrong. I think it should be a function in server source to block somehow moving the active equipment directly in the storage?

Thank you.

Link to comment
https://metin2.dev/topic/33391-weapon-costume-bug/
Share on other sites

  • Active Member

Something like:

int iWearCell = item->FindEquipCell(this);
if (iWearCell == WEAR_WEAPON && GetWear(WEAR_COSTUME_WEAPON))
{
	return false;
}

in MoveItem() function, under:

	if (Cell.IsEquipPosition())
	{
		if (!CanUnequipNow(item))
			return false;

 

not tested

Link to comment
https://metin2.dev/topic/33391-weapon-costume-bug/#findComment-169073
Share on other sites

On 1/16/2025 at 10:50 PM, jking said:

Something like:

int iWearCell = item->FindEquipCell(this);
if (iWearCell == WEAR_WEAPON && GetWear(WEAR_COSTUME_WEAPON))
{
	return false;
}

in MoveItem() function, under:

	if (Cell.IsEquipPosition())
	{
		if (!CanUnequipNow(item))
			return false;

 

not tested

I tried but is not working. Compiled without errors but the bug is still there. I think i shouldn't be able to move the equipped items in storage regardless of this skin system. You should be able to move only items from your inventory not your active equipment...

Take a look to the bug: 

This is the hidden content, please

I just need to block moving the active equipment in the storage somehow i think.

Edited by minigutza
  • Metin2 Dev 3
  • Good 1
  • Love 1
Link to comment
https://metin2.dev/topic/33391-weapon-costume-bug/#findComment-169166
Share on other sites

Above int iWearCell = item->FindEquipCell(this); in char_item.cpp (Inside MoveItem function) ->

Add the following:
 

		if ((DestCell.window_type == SAFEBOX && item->IsEquipped()) || (Cell.window_type == SAFEBOX && DestCell.IsEquipPosition()))
		{
			return false;
		}

The code is piss shit but will work

  • Metin2 Dev 1

Software Engineer @ CNH Industrial (NAFTA/EMEA)

Link to comment
https://metin2.dev/topic/33391-weapon-costume-bug/#findComment-169196
Share on other sites

19 minutes ago, Khabib Nurmagomedov said:

Above int iWearCell = item->FindEquipCell(this); in char_item.cpp (Inside MoveItem function) ->

Add the following:
 

		if ((DestCell.window_type == SAFEBOX && item->IsEquipped()) || (Cell.window_type == SAFEBOX && DestCell.IsEquipPosition()))
		{
			return false;
		}

The code is piss shit but will work

I can't find int iWearCell = item->FindEquipCell(this) inside the MoveItem function.

I added inside it, like here

	if (DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ ¾ÆÀÌÅÛÀº º§Æ® Àκ¥Å丮·Î ¿Å±æ ¼ö ¾ø½À´Ï´Ù."));			
		return false;
	}

	// ÀÌ¹Ì Âø¿ëÁßÀÎ ¾ÆÀÌÅÛÀ» ´Ù¸¥ °÷À¸·Î ¿Å±â´Â °æ¿ì, 'ÀåÃ¥ ÇØÁ¦' °¡´ÉÇÑ Áö È®ÀÎÇÏ°í ¿Å±è
	if (Cell.IsEquipPosition() && !CanUnequipNow(item))
		return false;

	if ((DestCell.window_type == SAFEBOX && item->IsEquipped()) || (Cell.window_type == SAFEBOX && DestCell.IsEquipPosition()))
		{
			return false;
		}

	if (DestCell.IsEquipPosition())
	{
		if (GetItem(DestCell))	// ÀåºñÀÏ °æ¿ì ÇÑ °÷¸¸ °Ë»çÇØµµ µÈ´Ù.
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ¹Ì Àåºñ¸¦ Âø¿ëÇϰí ÀÖ½À´Ï´Ù."));
			
			return false;
		}

 but is not working. I still can move equipped items to the storage. Should be placed somewhere else? Thanks.

Link to comment
https://metin2.dev/topic/33391-weapon-costume-bug/#findComment-169197
Share on other sites

10 hours ago, minigutza said:

I can't find int iWearCell = item->FindEquipCell(this) inside the MoveItem function.

I added inside it, like here

	if (DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ ¾ÆÀÌÅÛÀº º§Æ® Àκ¥Å丮·Î ¿Å±æ ¼ö ¾ø½À´Ï´Ù."));			
		return false;
	}

	// ÀÌ¹Ì Âø¿ëÁßÀÎ ¾ÆÀÌÅÛÀ» ´Ù¸¥ °÷À¸·Î ¿Å±â´Â °æ¿ì, 'ÀåÃ¥ ÇØÁ¦' °¡´ÉÇÑ Áö È®ÀÎÇÏ°í ¿Å±è
	if (Cell.IsEquipPosition() && !CanUnequipNow(item))
		return false;

	if ((DestCell.window_type == SAFEBOX && item->IsEquipped()) || (Cell.window_type == SAFEBOX && DestCell.IsEquipPosition()))
		{
			return false;
		}

	if (DestCell.IsEquipPosition())
	{
		if (GetItem(DestCell))	// ÀåºñÀÏ °æ¿ì ÇÑ °÷¸¸ °Ë»çÇØµµ µÈ´Ù.
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ¹Ì Àåºñ¸¦ Âø¿ëÇϰí ÀÖ½À´Ï´Ù."));
			
			return false;
		}

 but is not working. I still can move equipped items to the storage. Should be placed somewhere else? Thanks.

That's sort of weird as it fixes the issue on my side, do you mind leaving your discord here so i can have a further look?

  • Love 1

Software Engineer @ CNH Industrial (NAFTA/EMEA)

Link to comment
https://metin2.dev/topic/33391-weapon-costume-bug/#findComment-169201
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.