summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-22 00:44:09 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-22 00:44:09 +0000
commita64c5b01e683e76def759e6e871ceee330c9ae09 (patch)
treecc65bb71e89df3ce933aaa3ef52884e350f35efa /src/game.cpp
parent423bd85aa1ca8051129df388aa2211dfbbe8ec1e (diff)
downloadmana-a64c5b01e683e76def759e6e871ceee330c9ae09.tar.gz
mana-a64c5b01e683e76def759e6e871ceee330c9ae09.tar.bz2
mana-a64c5b01e683e76def759e6e871ceee330c9ae09.tar.xz
mana-a64c5b01e683e76def759e6e871ceee330c9ae09.zip
Picking up now possible with Z, and fixed width of a few scroll area contents.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp84
1 files changed, 41 insertions, 43 deletions
diff --git a/src/game.cpp b/src/game.cpp
index bc56578a..6aad95fd 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -321,53 +321,51 @@ void do_input()
}
}
- if (keysym.sym == SDLK_g && !chatWindow->isFocused())
+ if ((keysym.sym == SDLK_g || keysym.sym == SDLK_z) &&
+ !chatWindow->isFocused())
{
// Get the item code
- if (!chatWindow->isFocused())
+ used = true;
+ int id = 0;
+ id = find_floor_item_by_cor(player_node->x, player_node->y);
+ if (id != 0)
{
- used = true;
- int id = 0;
- id = find_floor_item_by_cor(player_node->x, player_node->y);
- if (id != 0)
- {
- WFIFOW(0) = net_w_value(0x009f);
- WFIFOL(2) = net_l_value(id);
- WFIFOSET(6);
- }
- else {
- switch (player_node->direction) {
- case NORTH:
- id = find_floor_item_by_cor(player_node->x, player_node->y-1);
- break;
- case SOUTH:
- id = find_floor_item_by_cor(player_node->x, player_node->y+1);
- break;
- case WEST:
- id = find_floor_item_by_cor(player_node->x-1, player_node->y);
- break;
- case EAST:
- id = find_floor_item_by_cor(player_node->x+1, player_node->y);
- break;
- case NW:
- id = find_floor_item_by_cor(player_node->x-1, player_node->y-1);
- break;
- case NE:
- id = find_floor_item_by_cor(player_node->x+1, player_node->y-1);
- break;
- case SW:
- id = find_floor_item_by_cor(player_node->x-1, player_node->y+1);
- break;
- case SE:
- id = find_floor_item_by_cor(player_node->x+1, player_node->y+1);
- break;
- default:
- break;
- }
- WFIFOW(0) = net_w_value(0x009f);
- WFIFOL(2) = net_l_value(id);
- WFIFOSET(6);
+ WFIFOW(0) = net_w_value(0x009f);
+ WFIFOL(2) = net_l_value(id);
+ WFIFOSET(6);
+ }
+ else {
+ switch (player_node->direction) {
+ case NORTH:
+ id = find_floor_item_by_cor(player_node->x, player_node->y-1);
+ break;
+ case SOUTH:
+ id = find_floor_item_by_cor(player_node->x, player_node->y+1);
+ break;
+ case WEST:
+ id = find_floor_item_by_cor(player_node->x-1, player_node->y);
+ break;
+ case EAST:
+ id = find_floor_item_by_cor(player_node->x+1, player_node->y);
+ break;
+ case NW:
+ id = find_floor_item_by_cor(player_node->x-1, player_node->y-1);
+ break;
+ case NE:
+ id = find_floor_item_by_cor(player_node->x+1, player_node->y-1);
+ break;
+ case SW:
+ id = find_floor_item_by_cor(player_node->x-1, player_node->y+1);
+ break;
+ case SE:
+ id = find_floor_item_by_cor(player_node->x+1, player_node->y+1);
+ break;
+ default:
+ break;
}
+ WFIFOW(0) = net_w_value(0x009f);
+ WFIFOL(2) = net_l_value(id);
+ WFIFOSET(6);
}
}
} // End key down