diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-12 15:05:17 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-12 15:05:17 +0000 |
commit | 00f7f9b9e2f72595e56af9c40d97fbd73408df54 (patch) | |
tree | 405eb7ba476ba0d446d0c50263fed41cc33ffd1f /src | |
parent | 3fec823429f792645dfd3ad34aed536086f81dfa (diff) | |
download | hercules-00f7f9b9e2f72595e56af9c40d97fbd73408df54.tar.gz hercules-00f7f9b9e2f72595e56af9c40d97fbd73408df54.tar.bz2 hercules-00f7f9b9e2f72595e56af9c40d97fbd73408df54.tar.xz hercules-00f7f9b9e2f72595e56af9c40d97fbd73408df54.zip |
- Updated npc_event_dequeue to free up your current npc information, and not just the npc_id
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9472 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/npc.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index d322fc530..6e39f3a20 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -162,7 +162,21 @@ int npc_event_dequeue(struct map_session_data *sd) { nullpo_retr(0, sd); - sd->npc_id=0; + if(sd->npc_id) + { //Current script is aborted. + if(sd->state.using_fake_npc){ + clif_clearchar_id(sd->npc_id, 0, sd->fd); + sd->state.using_fake_npc = 0; + } + if (sd->st) { + sd->st->pos = -1; + script_free_stack(sd->st->stack); + aFree(sd->st); + sd->st = NULL; + } + sd->npc_id = 0; + } + if (!sd->eventqueue[0][0]) return 0; //Nothing to dequeue @@ -1079,7 +1093,6 @@ int npc_click(struct map_session_data *sd,struct npc_data *nd) switch(nd->bl.subtype) { case SHOP: clif_npcbuysell(sd,nd->bl.id); - npc_event_dequeue(sd); break; case SCRIPT: run_script(nd->u.scr.script,0,sd->bl.id,nd->bl.id); |