diff --git a/src/interface/identify_and_appraise.cpp b/src/interface/identify_and_appraise.cpp index b7c8f6160..91bcb8465 100644 --- a/src/interface/identify_and_appraise.cpp +++ b/src/interface/identify_and_appraise.cpp @@ -407,6 +407,13 @@ int getAppraisalTime(Item* item) return appraisal_time; } +void closeIdentifyGUI() +{ + identifygui_active = false; + + selectedIdentifySlot = -1; +} + inline Item* getItemInfoFromIdentifyGUI(int slot) { if ( slot >= 4 ) diff --git a/src/interface/interface.hpp b/src/interface/interface.hpp index de2366536..f15727979 100644 --- a/src/interface/interface.hpp +++ b/src/interface/interface.hpp @@ -217,6 +217,7 @@ extern int selectedIdentifySlot; void selectIdentifySlot(int slot); void warpMouseToSelectedIdentifySlot(); +void closeIdentifyGUI(); void updateIdentifyGUI(); //Updates the identify item GUI. void identifyGUIIdentify(Item* item); //Identify the given item. int getAppraisalTime(Item* item); // Return time in ticks needed to appraise an item diff --git a/src/magic/castSpell.cpp b/src/magic/castSpell.cpp index 301aa48e2..ef764bc98 100644 --- a/src/magic/castSpell.cpp +++ b/src/magic/castSpell.cpp @@ -556,7 +556,7 @@ Entity* castSpell(Uint32 caster_uid, spell_t* spell, bool using_magicstaff, bool if (i != 0) { //Tell the client to uncurse an item. - strcpy((char*)net_packet->data, "RCUR"); //TODO: Send a different packet, to pop open the remove curse GUI. + strcpy((char*)net_packet->data, "CRCU"); net_packet->address.host = net_clients[i - 1].host; net_packet->address.port = net_clients[i - 1].port; net_packet->len = 4; @@ -569,6 +569,10 @@ Entity* castSpell(Uint32 caster_uid, spell_t* spell, bool using_magicstaff, bool gui_mode = GUI_MODE_INVENTORY; //Reset the GUI to the inventory. removecursegui_active = true; identifygui_active = false; + if ( identifygui_active ) + { + closeIdentifyGUI(); + } if ( openedChest[i] ) { openedChest[i]->closeChest(); diff --git a/src/net.cpp b/src/net.cpp index 9ff24af91..06658b685 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2409,6 +2409,28 @@ void clientHandlePacket() return; } + //Open up the Remove Curse GUI + else if ( !strncmp((char*)net_packet->data, "CRCU", 4) ) + { + removecursegui_active = true; + shootmode = false; + gui_mode = GUI_MODE_INVENTORY; //Reset the GUI to the inventory. + if ( identifygui_active ) + { + closeIdentifyGUI(); + } + if ( openedChest[clientnum] ) + { + openedChest[clientnum]->closeChest(); + } + + //Initialize Remove Curse GUI game controller code here. + initRemoveCurseGUIControllerCode(); + + return; + } + + //Add a spell to the channeled spells list. else if (!strncmp((char*)net_packet->data, "CHAN", 4)) {