Skip to content

Short-circuiting if statements are incorrectly parsed #2

@Pokechu22

Description

@Pokechu22

Certain packets with more complicated if statements (IE, ones that aren't just if (flag) but instead if (var == 1 || var == 2)) are parsed as if they were if (var).

For example, the world border packet is incorrectly parsed. It is currently parsed as

writeString(a);
writeByte(d);
if(d) {
  writeString(b);
  writeString(c.a());
}

but should actually be

writeString(a);
writeByte(d);
if(d == 0 || d == 2) {
  writeString(b);
  writeString(c.a());
}

The same applies with the teams packet and a few others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions