summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine.h3
-rw-r--r--src/game.cpp21
-rw-r--r--src/gui/popupmenu.cpp36
3 files changed, 19 insertions, 41 deletions
diff --git a/src/engine.h b/src/engine.h
index 03a9cf2e..1d0e6d3a 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -48,6 +48,9 @@
#include "map.h"
#include "graphic/spriteset.h"
+extern int map_x, map_y, camera_x, camera_y;
+extern char npc_button[10];
+
extern ChatWindow *chatWindow;
extern StatusWindow *statusWindow;
extern BuyDialog *buyDialog;
diff --git a/src/game.cpp b/src/game.cpp
index 27583d92..bee62b0c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -259,12 +259,6 @@ void do_input()
displayPathToMouse = !displayPathToMouse;
}
- // Play sound (debug purpose)
- else if ((keysym.sym == SDLK_F7))
- {
- sound.playSfx("sfx/fist-swish.ogg");
- }
-
// Input chat window
else if ((keysym.sym == SDLK_RETURN) && !chatWindow->isFocused())
{
@@ -436,10 +430,16 @@ void do_input()
* TODO: Move player to mouse click position before
* attack the monster (maybe using follow mode).
*/
- if ((keys[SDLK_LSHIFT]) &&
- (target->action != MONSTER_DEAD))
- autoTarget = target;
- attack(target);
+ if (target->action != MONSTER_DEAD &&
+ player_node->action==STAND)
+ {
+ if (keys[SDLK_LSHIFT])
+ {
+ autoTarget = target;
+ }
+ attack(target);
+
+ }
}
// Player default: trade
else if (target->isPlayer())
@@ -622,7 +622,6 @@ void do_input()
{
if (keys[SDLK_LCTRL])
{
- player_node->action = ATTACK;
Being *monster = attack(x, y, player_node->direction);
if (keys[SDLK_LSHIFT]) {
autoTarget = monster;
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index f58312db..c9b53324 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -77,11 +77,7 @@ void PopupMenu::showPopup(int mx, int my)
if (being)
{
- if (being->isMonster())
- {
- browserBox->addRow("@@attack|Attack Monster@@");
- }
- else if (being->isNpc())
+ if (being->isNpc())
{
browserBox->addRow("@@talk|Talk To NPC@@");
}
@@ -90,7 +86,7 @@ void PopupMenu::showPopup(int mx, int my)
std::string name = being->name;
//browserBox->addRow("@@attack|Attack " + name + "@@");
browserBox->addRow("@@trade|Trade With " + name + "@@");
- browserBox->addRow("@@follow|Follow " + name + "@@");
+ //browserBox->addRow("@@follow|Follow " + name + "@@");
//browserBox->addRow("@@buddy|Add " + name + " to Buddy List@@");
}
}
@@ -99,10 +95,7 @@ void PopupMenu::showPopup(int mx, int my)
std::string name = itemDb->getItemInfo(floorItem->id)->getName();
browserBox->addRow("@@pickup|Pick Up " + name + "@@");
}
- else
- {
- browserBox->addRow("@@walk|Walk To@@");
- }
+
//browserBox->addRow("@@look|Look To@@");
browserBox->addRow("##3---");
browserBox->addRow("@@cancel|Cancel@@");
@@ -139,18 +132,8 @@ void PopupMenu::draw(gcn::Graphics* graphics)
void PopupMenu::handleLink(const std::string& link)
{
- // Attack action
- if ((link == "attack") && being)
- {
- if (being->isMonster() && (being->action != MONSTER_DEAD))
- {
- autoTarget = being;
- attack(being);
- }
- }
-
// Talk To action
- else if ((link == "talk") && being && being->isNpc() &&
+ if ((link == "talk") && being && being->isNpc() &&
(current_npc == 0))
{
WFIFOW(0) = net_w_value(0x0090);
@@ -167,11 +150,11 @@ void PopupMenu::handleLink(const std::string& link)
WFIFOL(2) = net_l_value(being->id);
WFIFOSET(6);
}
-
+ /*
// Follow Player action
else if (link == "follow")
{
- }
+ }*/
/*
// Add Buddy action
@@ -191,13 +174,6 @@ void PopupMenu::handleLink(const std::string& link)
WFIFOSET(6);
}
- // Walk To action
- else if ((link == "walk") && (mX != -1) && (mY != -1))
- {
- walk(mX, mY, 0);
- player_node->setDestination(mX, mY);
- }
-
// Look To action
else if (link == "look")
{