|
@@ -10794,19 +10794,32 @@ void clif_progressbar_abort(struct map_session_data * sd)
|
|
|
}
|
|
|
|
|
|
|
|
|
-/// Notification from the client, that the progress bar has reached 100% (CZ_PROGRESS).
|
|
|
-/// 02f1
|
|
|
-void clif_parse_progressbar(int fd, struct map_session_data * sd)
|
|
|
-{
|
|
|
+/// Notification from the client, that the progress bar has reached 100%.
|
|
|
+/// 02f1 (CZ_PROGRESS)
|
|
|
+void clif_parse_progressbar(int fd, struct map_session_data * sd){
|
|
|
+ // No progressbar active, ignore it
|
|
|
+ if( !sd->progressbar.npc_id ){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
int npc_id = sd->progressbar.npc_id;
|
|
|
+ bool closing = false;
|
|
|
|
|
|
- if( gettick() < sd->progressbar.timeout && sd->st )
|
|
|
- sd->st->state = END;
|
|
|
+ // Check if the progress was canceled
|
|
|
+ if( gettick() < sd->progressbar.timeout && sd->st ){
|
|
|
+ closing = true;
|
|
|
+ sd->st->state = CLOSE; // will result in END in npc_scriptcont
|
|
|
+
|
|
|
+ // If a message window was open, offer a close button to the user
|
|
|
+ if( sd->st->mes_active ){
|
|
|
+ clif_scriptclose( sd, npc_id );
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
sd->progressbar.npc_id = 0;
|
|
|
sd->progressbar.timeout = 0;
|
|
|
sd->state.workinprogress = WIP_DISABLE_NONE;
|
|
|
- npc_scriptcont(sd, npc_id, false);
|
|
|
+ npc_scriptcont(sd, npc_id, closing);
|
|
|
}
|
|
|
|
|
|
/// Displays cast-like progress bar on a NPC
|