Bitmask Enum incorrect values
I have a bitmask enum I've declared in the following manner:
I'm using in an actor as follows:
However when I'm checking its values as I'm manipulating it, Key1 maps to a value of 2; Key 2 maps to a value of 4; Key3 maps to a value of 16; Key 4 maps to a value of 256; Key5 maps to a value of 65,536 and Key6 is unusable.
Oddly, when I print out the value of one of the enum values on its own I.e:
It prints out the value I would expect, Where X is 1 or 6, I'd get 1 or 32.
I've tried changing the values to use a hexadecimal value instead in case that did something, but to no avail, I also tried using the actor variable as a uint8, but then I only have access to the first 3 options. Does anyone have any ideas?
Having looked around a bit more, it seems this issue is covered by bug UE-32816.
The bug outlines that it is actually as intended functionality, and the bitmask values, rather than 1, 2, 4, 8 .... it should simply be 1, 2, 3, 4, 5.... where the value is actually interpreted as 1 << N rather than N itself.
I'm unsure if I should delete my post at this point or leave this here for posterity.
answered Sep 22 '16 at 04:07 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here