Fixed an issue with progressbars (#3945)
Additionally if progress was being canceled and a message window was active, the user would be stuck, because no close button would show. Fixes #3944 Thanks to @teededung, @cahya1992 and @Atemo
This commit is contained in:
parent
51d5d9f5ca
commit
fc92a97978
@ -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).
|
/// Notification from the client, that the progress bar has reached 100%.
|
||||||
/// 02f1
|
/// 02f1 (CZ_PROGRESS)
|
||||||
void clif_parse_progressbar(int fd, struct map_session_data * sd)
|
void clif_parse_progressbar(int fd, struct map_session_data * sd){
|
||||||
{
|
// No progressbar active, ignore it
|
||||||
int npc_id = sd->progressbar.npc_id;
|
if( !sd->progressbar.npc_id ){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( gettick() < sd->progressbar.timeout && sd->st )
|
int npc_id = sd->progressbar.npc_id;
|
||||||
sd->st->state = END;
|
bool closing = false;
|
||||||
|
|
||||||
|
// 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.npc_id = 0;
|
||||||
sd->progressbar.timeout = 0;
|
sd->progressbar.timeout = 0;
|
||||||
sd->state.workinprogress = WIP_DISABLE_NONE;
|
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
|
/// Displays cast-like progress bar on a NPC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user