summaryrefslogtreecommitdiff
path: root/src/gui/npcstringdialog.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-25 00:50:33 -0700
committerIra Rice <irarice@gmail.com>2009-02-25 00:50:33 -0700
commitd8bc3a6418c5027d7f6c42ce8f8dceca8dee8971 (patch)
treefbb0b461bd151cbf3ad5aeedb80257140253f57c /src/gui/npcstringdialog.cpp
parenta1e483913672e55704e8fbafeff5ea0ccc0c9b07 (diff)
downloadmana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.gz
mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.bz2
mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.xz
mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.zip
Fixed up NPC list dialogs to be navigatable by keyboard (scrolling
through the list requires the use of the mouse wheel at the moment), fixed wrapping behavior for wrapping around lists to actually wrap around lists properly, and placed a few checks for current_npc where they were assumed before which could cause the client to hang or crash in case the NPC is no longer around. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/npcstringdialog.cpp')
-rw-r--r--src/gui/npcstringdialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/npcstringdialog.cpp b/src/gui/npcstringdialog.cpp
index ef2de73a..140ca40f 100644
--- a/src/gui/npcstringdialog.cpp
+++ b/src/gui/npcstringdialog.cpp
@@ -64,7 +64,10 @@ void NpcStringDialog::action(const gcn::ActionEvent &event)
}
setVisible(false);
- current_npc->stringInput(mValueField->getText());
+
+ if (current_npc)
+ current_npc->stringInput(mValueField->getText());
+
current_npc = NULL;
mValueField->setText("");
}