Paulix
Active Member
- Joined
- Sep 13, 2012
- Messages
- 129
- Solutions
- 7
- Reaction score
- 26
Hello, I'm trying to check if an item can be use on slots 1, 4, 7, 8, 12 (Head, Armor, Legs, Feet or Hands)
Enums on src looks like this...
but using getSlotPosition(), it is returning the flag value like this
I didn't want to make the numbers manually, like 49, 50, 56 etc...
How can I convert the return from getSlotPosition to and integer to compare with those constants like CONST_SLOT_AMMO?
Enums on src looks like this...
C++:
enum slots_t : uint8_t {
CONST_SLOT_WHEREEVER = 0,
CONST_SLOT_HEAD = 1,
CONST_SLOT_NECKLACE = 2,
CONST_SLOT_BACKPACK = 3,
CONST_SLOT_ARMOR = 4,
CONST_SLOT_RIGHT = 5,
CONST_SLOT_LEFT = 6,
CONST_SLOT_LEGS = 7,
CONST_SLOT_FEET = 8,
CONST_SLOT_RING = 9,
CONST_SLOT_AMMO = 10,
CONST_SLOT_FIRST = CONST_SLOT_HEAD,
CONST_SLOT_LAST = CONST_SLOT_AMMO,
};
but using getSlotPosition(), it is returning the flag value like this
C++:
enum SlotPositionBits : uint32_t {
SLOTP_WHEREEVER = 0xFFFFFFFF,
SLOTP_HEAD = 1 << 0,
SLOTP_NECKLACE = 1 << 1,
SLOTP_BACKPACK = 1 << 2,
SLOTP_ARMOR = 1 << 3,
SLOTP_RIGHT = 1 << 4,
SLOTP_LEFT = 1 << 5,
SLOTP_LEGS = 1 << 6,
SLOTP_FEET = 1 << 7,
SLOTP_RING = 1 << 8,
SLOTP_AMMO = 1 << 9,
SLOTP_DEPOT = 1 << 10,
SLOTP_TWO_HAND = 1 << 11,
SLOTP_HAND = (SLOTP_LEFT | SLOTP_RIGHT)
};
I didn't want to make the numbers manually, like 49, 50, 56 etc...
How can I convert the return from getSlotPosition to and integer to compare with those constants like CONST_SLOT_AMMO?