summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-21 10:08:22 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-21 10:08:22 +0000
commit7ae0ee3c79bb74b9a5cb15511471d160fb4ad7c1 (patch)
treeb8cca5ce9bd14fafced1700412fd9850f41daca8
parent0c7c90968978a122311e1f99e739a57440153c4e (diff)
downloadmana-7ae0ee3c79bb74b9a5cb15511471d160fb4ad7c1.tar.gz
mana-7ae0ee3c79bb74b9a5cb15511471d160fb4ad7c1.tar.bz2
mana-7ae0ee3c79bb74b9a5cb15511471d160fb4ad7c1.tar.xz
mana-7ae0ee3c79bb74b9a5cb15511471d160fb4ad7c1.zip
Moved the joypad button checks to the according keyboard checks to reduce code duplication
-rw-r--r--src/game.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/game.cpp b/src/game.cpp
index bbb9d918..a1e5b19a 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -328,7 +328,7 @@ void do_input()
}
// Player sit action
- else if ((keysym.sym == SDLK_F5) && action_time)
+ else if (((keysym.sym == SDLK_F5) || joy[JOY_BTN2]) && action_time)
{
if (player_node->action == STAND)
action(2, 0);
@@ -440,8 +440,8 @@ void do_input()
}
// Picking up items on the floor
- else if ((keysym.sym == SDLK_g || keysym.sym == SDLK_z) &&
- !chatWindow->isFocused())
+ else if (((keysym.sym == SDLK_g || keysym.sym == SDLK_z) &&
+ !chatWindow->isFocused()) || joy[JOY_BTN1])
{
unsigned short x = player_node->x;
unsigned short y = player_node->y;
@@ -725,26 +725,6 @@ void do_input()
}
}
}
-
- if (joy[JOY_BTN1]) {
- unsigned short x = player_node->x;
- unsigned short y = player_node->y;
- int id = find_floor_item_by_cor(x, y);
-
- if (id != 0)
- {
- WFIFOW(0) = net_w_value(0x009f);
- WFIFOL(2) = net_l_value(id);
- WFIFOSET(6);
- }
- }
- else if (joy[JOY_BTN2] && action_time) {
- if (player_node->action == STAND)
- action(2, 0);
- else if (player_node->action == SIT)
- action(3, 0);
- action_time = false;
- }
}
}