diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-09-18 17:41:37 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-09-18 17:41:37 +0000 |
commit | 074c842ff70f2d695d09a5ee07cee1fec7450518 (patch) | |
tree | 0c7ffb9ef669464cb948f72f548c71e4620ac478 /src/gui/npc.cpp | |
parent | 90cc1c54dc36574f56cde0306c11d3abc43fc893 (diff) | |
download | mana-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/gui/npc.cpp')
-rw-r--r-- | src/gui/npc.cpp | 24 |
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; + } } |