Index: src/map/atcommand.c =================================================================== --- src/map/atcommand.c (revision 17312) +++ src/map/atcommand.c (working copy) @@ -3726,10 +3726,18 @@ *------------------------------------------*/ ACMD_FUNC(reloadscript) { + struct s_mapiterator* iter; + struct map_session_data* pl_sd; + nullpo_retr(-1, sd); //atcommand_broadcast( fd, sd, "@broadcast", "Server is reloading scripts..." ); //atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" ); + iter = mapit_getallusers(); + for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) + pc_close_npc(pl_sd,2); + mapit_free(iter); + flush_fifos(); map_reloadnpc(true); // reload config files seeking for npcs script_reload(); Index: src/map/npc.c =================================================================== --- src/map/npc.c (revision 17312) +++ src/map/npc.c (working copy) @@ -1287,11 +1287,11 @@ sd->state.callshop = 0; sd->npc_shopid = id; - if (type==0) { + if(type==0) clif_buylist(sd,nd); - } else { + else clif_selllist(sd); - } + return 0; } /*========================================== @@ -1676,9 +1676,7 @@ nullpo_retr(1, item_list); if( ( nd = npc_checknear(sd, map_id2bl(sd->npc_shopid)) ) == NULL || nd->subtype != SHOP ) - { return 1; - } z = 0; Index: src/map/pc.c =================================================================== --- src/map/pc.c (revision 17312) +++ src/map/pc.c (working copy) @@ -6584,11 +6584,12 @@ { nullpo_retv(sd); - if (sd->npc_id) { + if (sd->npc_id || sd->npc_shopid) { if (sd->state.using_fake_npc) { clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd); sd->state.using_fake_npc = 0; } + if (sd->st) { if(sd->st->state == RUN){ //wait ending code execution add_timer(gettick()+500,pc_close_npc_timer,sd->bl.id,flag); @@ -6599,6 +6600,7 @@ } sd->state.menu_or_input = 0; sd->npc_menu = 0; + sd->npc_shopid = 0; #ifdef SECURE_NPCTIMEOUT sd->npc_idle_timer = INVALID_TIMER; #endif