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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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