micartey / Cardinal-Anticheat

Cardinal Anticheat (CAC) - Spigot Anticheat
https://cardinalanticheat.github.io/documentation
19 stars 2 forks source link

Bug Report | Corrupted Lag Compensated World #204

Closed micartey closed 6 days ago

micartey commented 1 week ago

Information

Sometimes on just some very few locations, the lag compensated world is wrong and returns the wrong block.

When does the bug occure?

This seems to happen when the player is close to (or on) an 0-axis. (Note to me: Player Environment line 254)

For now, please move the world etc. to a quadrant away from the origin and 0-axis.

Cardinal Version

All Versions as of 17.11.2024

Spigot Version

All spigot versions

Additional information

No response

micartey commented 6 days ago

The issue was caused by a collision in calculating the index for block locations:

private long getBlockIndex(int x, int y, int z) {
    return (long) x * z + y;
}

This was obviously a bad formula to calculate an index and collided when either x or z was 0