Jump to content
Sign in to follow this  
bWolfie

@refresh NPC Fix

Recommended Posts

This fixes the client hang issue when using the @refresh command while a NPC dialog box/menu is open. I don't know if this plugin will compile, as I made it on the fly, but the command fix definitely works. :)
Inspired from npc_rr_secure_timeout_timer

Download: https://pastebin.com/zUzYyz1S

ACMD(refresh)
{
    if (sd->npc_id) {
        /**
         * If we still have the NPC script attached, tell it to stop.
         **/
        if (sd->st)
            sd->st->state = END;
        sd->state.menu_or_input = 0;
        sd->npc_menu = 0;
        clif->scriptclose(sd, sd->npc_id);
        /**
        * We will end the script ourselves, client will request to end it again if it have dialog,
        * however it will be ignored, workaround for client stuck if NPC have no dialog. [hemagx]
        **/
        sd->state.dialog = 0;
        npc->scriptcont(sd, sd->npc_id, true);
    }

    clif->refresh(sd);
    return true;
}

Edited by Myriad
include acmd preview

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.