Jump to content
  • 0

Adding specific bonuses for customes, raises case error


astroNOT

Question

  • VIP

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 post

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.



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