From 04251494ebf61d3fba1a0b87cb80e90c6c9e32fd Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 5 Jul 2013 22:49:38 -0300 Subject: Fixed GM's unloadnpc via right click Signed-off-by: shennetsind --- src/map/clif.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index c62791f31..c802929b4 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -13255,9 +13255,14 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) case BL_NPC: { - char command[NAME_LENGTH+11]; - sprintf(command, "%cunloadnpc %s", atcommand->at_symbol, iStatus->get_name(target)); - atcommand->parse(fd, sd, command, 1); + struct npc_data* nd = (struct npc_data *)target; + if( !pc->can_use_command(sd, "@unloadnpc")) { + clif->GM_kickack(sd, 0); + return; + } + npc_unload_duplicates(nd); + npc_unload(nd,true); + npc_read_event_script(); } break; -- cgit v1.2.3-60-g2f50