From 074c842ff70f2d695d09a5ee07cee1fec7450518 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 18 Sep 2005 17:41:37 +0000 Subject: Updated dev-cpp project file to last changes, and fixed the bug with npc lists I introduced earlier. --- src/gui/npc.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src') 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; + } } -- cgit v1.2.3-70-g09d2