Jump to content

[BUG] Costume Weapon -> Rod, Pickaxe


Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.