Jump to content

Adding specific bonuses for customes, raises case error


Recommended Posts

  • Premium

Following 

 

For this switch statement:

if (GetType() == ITEM_ARMOR)
    {
        switch (GetSubType())
        {
            case ARMOR_BODY:
                return ATTRIBUTE_SET_BODY;

            case ARMOR_WRIST:
                return ATTRIBUTE_SET_WRIST;

            case ARMOR_FOOTS:
                return ATTRIBUTE_SET_FOOTS;

            case ARMOR_NECK:
                return ATTRIBUTE_SET_NECK;

            case ARMOR_HEAD:
                return ATTRIBUTE_SET_HEAD;

            case ARMOR_SHIELD:
                return ATTRIBUTE_SET_SHIELD;

            case ARMOR_EAR:
                return ATTRIBUTE_SET_EAR;
            
            case COSTUME_BODY:
                return ATTRIBUTE_COSTUME_B;
        }
    } else if (GetType() == ITEM_COSTUME){

        return ATTRIBUTE_COSTUME_B;}

 

I get:

item_attribute.cpp:52:13: error: duplicate case value
             case COSTUME_BODY:
             ^
item_attribute.cpp:31:13: error: previously used here
             case ARMOR_BODY:
             ^

 

Armor body is defined in item_length.cpp:

enum EArmorSubTypes
{
	ARMOR_BODY,

 

COSTUME_BODY is also defined in item_length.cpp:

enum ECostumeSubTypes
{
	COSTUME_BODY,

 

Any idea why does it see at as a duplicate?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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