Jump to content
  • 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 post

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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • 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.