Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment within conditional expression error #1090

Closed
Bizes opened this issue Dec 7, 2023 · 1 comment
Closed

Assignment within conditional expression error #1090

Bizes opened this issue Dec 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Bizes
Copy link

Bizes commented Dec 7, 2023

I am trying to write some ECS systems with flecs for Unreal 5.3 and got an "assignment within conditional expression" error.

Source\FlecsLibrary\Public\flecs.h(23181): error C4706: assignment within conditional expression
Source\FlecsLibrary\Public\flecs.h(23181): error C4706: assignment within conditional expression

To Reproduce
Create flecs entity and add components? I am not 100% sure what I changed to get this error because two days ago it worked and the only things I changed was adding a few more systems and components.

Error seems to come from this line in flecs.h(23181)
bool has_components; if ((has_components = get_ptrs(world, r, table, ptrs))) {

Changing it to
bool has_components= get_ptrs(world, r, table, ptrs); if ((has_components )) {
fixes it for me.

I also had it in another line in flecs.h, I think it was 23157.

Dont know if this is a bug in Unreal/ VS2022 but it works with this workaround. I also think the workaround will break anything.
If not feel free to remove the issue report.

@Bizes Bizes added the bug Something isn't working label Dec 7, 2023
@SanderMertens
Copy link
Owner

Fixed! I wasn't seeing this error in CI so I just fixed the two statements you mentioned. Let me know if the issue persists!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants