satoshinm / NetCraft

Web-based fork of fogleman/Craft ⛺
https://satoshinm.github.io/NetCraft/
MIT License
56 stars 13 forks source link

Crouching while falling but not flying allows hovering midair #181

Closed satoshinm closed 7 years ago

satoshinm commented 7 years ago

https://github.com/satoshinm/NetCraft/pull/146 for https://github.com/satoshinm/NetCraft/issues/4 has another issue besides https://github.com/satoshinm/NetCraft/issues/180: if you press shift while falling, you can hover indefinitely. This is intended to prevent falling off a ledge but applies too broadly to when the player is already falling:

        if (crouching && !g->flying) {
            if (oy != s->y) {
                // if crouching and was about to fall, don't move
                // TODO: sliding along either x/z axes
                s->x = ox;
                s->y = oy;
                s->z = oz;
            }