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

FLAG_OR+FLAG_DIFFERENT_VARIABLE Add support for OR in flags and for other variables in same statement #30

Closed
gtker opened this issue Oct 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@gtker
Copy link
Owner

gtker commented Oct 15, 2022

Wrath MovementInfo requires

struct MovementInfo {
    MovementFlags flags;
    ExtraMovementFlags extra_flags;
    u32 timestamp;
    Vector3d position;
    f32 orientation;
    if (flags & ON_TRANSPORT) {
        TransportInfo transport;
        if (extra_flags & INTERPOLATED_MOVEMENT) {
            u32 transport_time;
        }
    }
    if (flags & SWIMMING || flags & FLYING || extra_flags & ALWAYS_ALLOW_PITCHING) {
        f32 pitch1;
	}

Test case is

flag A : u8 {
	ONE = 1;
	TWO = 2;
}
flag B : u8 {
	FOUR = 4;
	EIGHT = 8;
}

struct T {
	A a;
	B b;
	if (a & ONE || a & TWO) {
		u8 one_two;
	}
}

and

struct T {
	A a;
	B b;
	if (a & ONE || a & TWO || b & FOUR) {
		u8 one_two_four;
	}
}

It is unknown exactly what the generated Rust code should look like.

@gtker gtker added the enhancement New feature or request label Oct 15, 2022
@gtker gtker changed the title Add support for OR in flags and for other variables in same statement FLAG_OR+FLAG_DIFFERENT_VARIABLE Add support for OR in flags and for other variables in same statement Nov 10, 2022
@gtker
Copy link
Owner Author

gtker commented Nov 10, 2022

SpellCastFlags also needs this.

@gtker gtker closed this as completed in 3dd462c Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant