summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-04-01 18:58:39 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-04-01 18:58:39 +0000
commiteb9881621f72ae96f0fdabb2680e57db6ac56d22 (patch)
treecee54b71c04450d015a534ddeabe724ff7a05481 /src
parent6f88f2409f1853ae205573257865462540f935fc (diff)
downloadhercules-eb9881621f72ae96f0fdabb2680e57db6ac56d22.tar.gz
hercules-eb9881621f72ae96f0fdabb2680e57db6ac56d22.tar.bz2
hercules-eb9881621f72ae96f0fdabb2680e57db6ac56d22.tar.xz
hercules-eb9881621f72ae96f0fdabb2680e57db6ac56d22.zip
- Fixed 'OnPCLogoutEvent' being queued and never executed if
the player was already talking to an npc. (bugreport:1209) - Fixed 'OnPCLogoutEvent' not triggering when changing map-servers (pc_setpos). - Combined some isequipped() in item scripts. (bugreport:4158) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14278 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.c3
-rw-r--r--src/map/pc.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
index b58033f1f..fb488cf15 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1569,6 +1569,9 @@ int map_quit(struct map_session_data *sd)
if (sd->npc_timer_id != -1) //Cancel the event timer.
npc_timerevent_quit(sd);
+ if (sd->npc_id)
+ npc_event_dequeue(sd);
+
npc_script_event(sd, NPCE_LOGOUT);
//Unit_free handles clearing the player related data,
diff --git a/src/map/pc.c b/src/map/pc.c
index 0df3cda48..91017cf22 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4005,6 +4005,9 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if(!sd->mapindex || map_mapname2ipport(mapindex,&ip,&port))
return 2;
+ if (sd->npc_id)
+ npc_event_dequeue(sd);
+ npc_script_event(sd, NPCE_LOGOUT);
//remove from map, THEN change x/y coordinates
unit_remove_map_pc(sd,clrtype);
sd->mapindex = mapindex;