summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-21 16:36:28 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-21 16:36:28 +0000
commit4333effa0e80c996c91e4014cf449c30a32120b7 (patch)
treec1bf02c3dcb30f4ada12c6146288c7f76f6875fe
parent7ae0ee3c79bb74b9a5cb15511471d160fb4ad7c1 (diff)
downloadmana-client-4333effa0e80c996c91e4014cf449c30a32120b7.tar.gz
mana-client-4333effa0e80c996c91e4014cf449c30a32120b7.tar.bz2
mana-client-4333effa0e80c996c91e4014cf449c30a32120b7.tar.xz
mana-client-4333effa0e80c996c91e4014cf449c30a32120b7.zip
Restore the joypad code, the 'new' code location wasn't checked for joypad events...
-rw-r--r--src/game.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a1e5b19a..bbb9d918 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) || joy[JOY_BTN2]) && action_time)
+ else if ((keysym.sym == SDLK_F5) && 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()) || joy[JOY_BTN1])
+ else if ((keysym.sym == SDLK_g || keysym.sym == SDLK_z) &&
+ !chatWindow->isFocused())
{
unsigned short x = player_node->x;
unsigned short y = player_node->y;
@@ -725,6 +725,26 @@ 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;
+ }
}
}