[Fix] Changed some input things to hopefully prevent blocking.
This commit is contained in:
parent
0c4e672f05
commit
44dbdaaf91
12
src/input.c
12
src/input.c
@ -142,7 +142,7 @@ static void input_key(int keynum, double value, int abs) {
|
||||
unsigned int t;
|
||||
|
||||
// Accelerating.
|
||||
if(INGAME() && KEY("accel")) {
|
||||
if(KEY("accel")) {
|
||||
if(abs)player_accel(value);
|
||||
else {
|
||||
// Prevent it from getting stuck.
|
||||
@ -160,7 +160,7 @@ static void input_key(int keynum, double value, int abs) {
|
||||
if(value == KEY_PRESS) input_accelLast = t;
|
||||
}
|
||||
// Turning left.
|
||||
else if(INGAME() && KEY("left")) {
|
||||
else if(KEY("left")) {
|
||||
// Set flags for facing correction.
|
||||
if(value == KEY_PRESS) { player_setFlag(PLAYER_TURN_LEFT); }
|
||||
else if(value == KEY_RELEASE) { player_rmFlag(PLAYER_TURN_LEFT); }
|
||||
@ -170,7 +170,7 @@ static void input_key(int keynum, double value, int abs) {
|
||||
if(player_turn < -1.) { player_turn = -1.; }// Make sure value is sane.
|
||||
}
|
||||
// Turning right.
|
||||
else if(INGAME() && KEY("right")) {
|
||||
else if(KEY("right")) {
|
||||
// Set flags for facing correction.
|
||||
if(value == KEY_PRESS) { player_setFlag(PLAYER_TURN_RIGHT); }
|
||||
else if(value == KEY_RELEASE) { player_rmFlag(PLAYER_TURN_RIGHT); }
|
||||
@ -181,7 +181,7 @@ static void input_key(int keynum, double value, int abs) {
|
||||
if(player_turn < -1.) { player_turn = -1.; } // Make sure value is sane.
|
||||
}
|
||||
// Turn around to face vel.
|
||||
else if(INGAME() && KEY("reverse")) {
|
||||
else if(KEY("reverse")) {
|
||||
if(value == KEY_PRESS) { player_setFlag(PLAYER_REVERSE); }
|
||||
else if(value == KEY_RELEASE) {
|
||||
player_rmFlag(PLAYER_REVERSE);
|
||||
@ -191,7 +191,7 @@ static void input_key(int keynum, double value, int abs) {
|
||||
}
|
||||
}
|
||||
// Shoot primary weapon. BOOM BOOM.
|
||||
else if(INGAME() && KEY("primary")) {
|
||||
else if(KEY("primary")) {
|
||||
if(value == KEY_PRESS) { player_setFlag(PLAYER_PRIMARY); }
|
||||
else if(value == KEY_RELEASE) { player_rmFlag(PLAYER_PRIMARY); }
|
||||
}
|
||||
@ -219,7 +219,7 @@ static void input_key(int keynum, double value, int abs) {
|
||||
if(value == KEY_PRESS) player_board();
|
||||
}
|
||||
// Shooting secondary weapon.
|
||||
else if(KEY("secondary") && INGAME() && NOHYP()) {
|
||||
else if(KEY("secondary") && NOHYP()) {
|
||||
if(value == KEY_PRESS) { player_setFlag(PLAYER_SECONDARY); }
|
||||
else if(value == KEY_RELEASE) { player_rmFlag(PLAYER_SECONDARY); }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user