diff options
author | shennetsind <ind@henn.et> | 2013-07-05 22:49:38 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-07-05 22:49:38 -0300 |
commit | 04251494ebf61d3fba1a0b87cb80e90c6c9e32fd (patch) | |
tree | 80637ed54a42a787948e5ecb3656350618f6999b | |
parent | 449a41af45d448e18006ef9c105c393592239de1 (diff) | |
download | hercules-04251494ebf61d3fba1a0b87cb80e90c6c9e32fd.tar.gz hercules-04251494ebf61d3fba1a0b87cb80e90c6c9e32fd.tar.bz2 hercules-04251494ebf61d3fba1a0b87cb80e90c6c9e32fd.tar.xz hercules-04251494ebf61d3fba1a0b87cb80e90c6c9e32fd.zip |
Fixed GM's unloadnpc via right click
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | src/map/clif.c | 11 |
1 files 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; |