Jump to content
×
×
  • Create New...
  • 0

[BUG] Costume Weapon -> Rod, Pickaxe


Cunoo

Question

Hi devs,

I have a little problem with rod and pickaxe

 

here is my code from char_item.cpp:

if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW || item->GetType() == ITEM_ROD || item->GetType() == ITEM_PICK)
	{
		LPITEM pkItem = GetWear(WEAR_COSTUME_WEAPON);
		if (pkItem)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("For can do this unwear the costume weapon."));
			return false;
		}
	}
	else if (item->GetType() == ITEM_COSTUME && item->GetSubType() == COSTUME_WEAPON)
	{
		LPITEM pkItem = GetWear(WEAR_WEAPON);
		if (!pkItem)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't wear a costume weapon without have a weapon weared."));
			return false;
		}
		else if (item->GetValue(3) != pkItem->GetSubType() || item->GetType() == ITEM_ROD || item->GetType() == ITEM_PICK)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't wear a costume weapon who has different type of your weapon."));
			return false;
		}
	}

And what is my problem? All works fine but.. I have problem with costume weapon SWORD.. Just I can use weapon costume (sword) on rod and pickaxe.. (other costumes are blocked //daggers, bow, twohand, bell, fan) Can anyone help me? It is not hard but I dont have so much knowledge (c++ amateur)

Thanks.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
34 minutes ago, Cunoo said:

Hi devs,

I have a little problem with rod and pickaxe

 

here is my code from char_item.cpp:

if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW || item->GetType() == ITEM_ROD || item->GetType() == ITEM_PICK)
	{
		LPITEM pkItem = GetWear(WEAR_COSTUME_WEAPON);
		if (pkItem)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("For can do this unwear the costume weapon."));
			return false;
		}
	}
	else if (item->GetType() == ITEM_COSTUME && item->GetSubType() == COSTUME_WEAPON)
	{
		LPITEM pkItem = GetWear(WEAR_WEAPON);
		if (!pkItem)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't wear a costume weapon without have a weapon weared."));
			return false;
		}
		else if (item->GetValue(3) != pkItem->GetSubType() || item->GetType() == ITEM_ROD || item->GetType() == ITEM_PICK)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't wear a costume weapon who has different type of your weapon."));
			return false;
		}
	}

And what is my problem? All works fine but.. I have problem with costume weapon SWORD.. Just I can use weapon costume (sword) on rod and pickaxe.. (other costumes are blocked //daggers, bow, twohand, bell, fan) Can anyone help me? It is not hard but I dont have so much knowledge (c++ amateur)

Thanks.

Edit: Fixed by yourself just idiot:)  code == -> != :)

  • Good 1
Link to comment
Share on other sites

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.


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.