summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-09-18 17:41:37 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-09-18 17:41:37 +0000
commit074c842ff70f2d695d09a5ee07cee1fec7450518 (patch)
tree0c7ffb9ef669464cb948f72f548c71e4620ac478 /src
parent90cc1c54dc36574f56cde0306c11d3abc43fc893 (diff)
downloadmana-074c842ff70f2d695d09a5ee07cee1fec7450518.tar.gz
mana-074c842ff70f2d695d09a5ee07cee1fec7450518.tar.bz2
mana-074c842ff70f2d695d09a5ee07cee1fec7450518.tar.xz
mana-074c842ff70f2d695d09a5ee07cee1fec7450518.zip
Updated dev-cpp project file to last changes, and fixed the bug with npc lists I introduced earlier.
Diffstat (limited to 'src')
-rw-r--r--src/gui/npc.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/gui/npc.cpp b/src/gui/npc.cpp
index 696b2825..122cffa6 100644
--- a/src/gui/npc.cpp
+++ b/src/gui/npc.cpp
@@ -111,7 +111,7 @@ NpcListDialog::reset()
void
NpcListDialog::action(const std::string& eventId)
{
- int choice = 0xff; // 0xff means cancel
+ int choice = 0;
if (eventId == "ok")
{
@@ -123,15 +123,19 @@ NpcListDialog::action(const std::string& eventId)
}
}
else if (eventId == "cancel")
- {
+ {
+ choice = 0xff; // 0xff means cancel
}
- MessageOut outMsg;
- outMsg.writeShort(CMSG_NPC_LIST_CHOICE);
- outMsg.writeLong(current_npc);
- outMsg.writeByte(choice);
- writeSet(7);
- setVisible(false);
- reset();
- current_npc = 0;
+ if (choice)
+ {
+ MessageOut outMsg;
+ outMsg.writeShort(CMSG_NPC_LIST_CHOICE);
+ outMsg.writeLong(current_npc);
+ outMsg.writeByte(choice);
+ writeSet(7);
+ setVisible(false);
+ reset();
+ current_npc = 0;
+ }
}