Integer to enum(byte) with strange casting result

Does this also break replication of enums over network? I recently tried to set one to replicated but I was seeing inconsistent results where value was correct on server but invalid on clients.

FWIW, I’d like to support CrispyVitamin’s request that this problem be fixed in 4.9. This is a horrible bug that will break quite a few existing Blueprints.

Hi,

I do support the “fix in 4.9” movement as this is, in my opinion a critical bug that would refrain most people if not everybody to move to 4.9. (as enums are present a little bit everywhere in engine)

It’s also quite a sneaky bug in my opinion.

I have no idea how does system under hood work. And I would sure love to help fix it. But I have no idea where to find ToByte functions :')

Thanks for workaround though. :slight_smile:

@sranck & erio It is worth noting, that in my experience, enums and my functions using them, did not break when I migrated to 4.9 - I only have issues when creating/implementing new ones. But I agree, a rapid fix would be much appreciated. This bug essentially makes a blueprint type unusable and I think should be considered a decent sized bug. workarounds for this are relatively long and tedious. To continue coding using workaround for several weeks/months before it is fixed means we will have a lot of extra work to do in order to revert our projects when bug is fixed; especially considering everything worked fine in 4.8.3

“Your workaround is good, and as I mentioned above, you can still use integers to set as long as you do a manual conversion ((x + 1) * 2).”

It also seems that this method is not working in my case.

I do loop, do the +1 * 2 on index. ToByte, then ToEBlocCategories (which is my enum).

Here is a screenshot of Enum, code that is meant to get all of names of enum and output log at runtime.

http://puu.sh/k0dKb/9b2c122771.png

As you can see, output states:
Armor (which corresponds to 2 in bytes)
Engine (which corresponds to 4 in bytes)
None (which corresponds to 6 in bytes)
None (which corresponds to 8 in bytes)
None (which corresponds to 10 in bytes)

What is bothering me is fact that it works on two first. But not on three others. Just why? x)

Hi all,

This bug has been fixed internally. You can integrate fix into your build now, if you’ve built from source, using this GitHub commit:

https://github.com/EpicGames/UnrealEngine/commit/bbe57016a064fe00fecd91dd7289f3e6873014af

We’ve pushed this issue up to developers as a possible integration for a future hotfix, but I cannot guarantee anything at this time. I will post here if I hear anything about it, one way or other.

@Erio: I’ll take a look at your setup later today and see if we can figure out why workaround isn’t working for you.

Thanks for follow-through. Unfortunately I don’t build mine from source so I will need to wait for next minor release. Hopefully that will be soon. Thanks again!

I got word today that we’re been approved to include two fixes for this bug in 4.9.1 hotfix, including one noted above. These should resolve both existing conversion issues and prevent future problems. hotfix should be coming soon.

Excellent thanks so much