Skip to content

Commit

Permalink
ANDROID: Do not limit situations where fast is enabled
Browse files Browse the repository at this point in the history
Before this commit autofast for Android was ignored if the user was sneaking, digging or building. There is no reason for this and it impedes movement control
  • Loading branch information
Zeno- committed May 15, 2015
1 parent 33a633a commit 99cf53c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2997,17 +2997,10 @@ void Game::updatePlayerControl(const CameraOrientation &cam)

#ifdef ANDROID
/* For Android, invert the meaning of holding down the fast button (i.e.
* holding down the fast button -- if there is one -- means walk), unless
* performing an action, sneaking or jumping.
* holding down the fast button -- if there is one -- means walk)
*/
const u32 autofast_exludebits =
(1U << 4) | (1U << 6) // jump, sneak
| (1U << 7) | (1U << 8); // left state, right state

if ((keypress_bits & autofast_exludebits) == 0) {
control.aux1 = control.aux1 ^ true;
keypress_bits ^= ((u32)(1U << 5));
}
control.aux1 = control.aux1 ^ true;
keypress_bits ^= ((u32)(1U << 5));
#endif

client->setPlayerControl(control);
Expand Down

0 comments on commit 99cf53c

Please sign in to comment.