diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-19 06:04:34 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-19 06:04:34 +0000 |
commit | 8f4119ce9a0b70de6380c1d032a4cb6e5b51787d (patch) | |
tree | b68f4fd457de57168ede9a1457853f7ad4e76f70 /src/map/npc.c | |
parent | 72d890661194b248620c5c353777cb96be18c821 (diff) | |
download | hercules-8f4119ce9a0b70de6380c1d032a4cb6e5b51787d.tar.gz hercules-8f4119ce9a0b70de6380c1d032a4cb6e5b51787d.tar.bz2 hercules-8f4119ce9a0b70de6380c1d032a4cb6e5b51787d.tar.xz hercules-8f4119ce9a0b70de6380c1d032a4cb6e5b51787d.zip |
* Fixed a deallocation mistake and some buffer overflows in npc_chat.c after doing rtfm@pcre.txt (all caused by incorrect usage of pcre api)
* Removed underscores in npc_chat.c's variable names (easier to read)
* Reindented the whole thing (used spaces half of the time ._.)
* Moved npc pcre-data deallocation from npc_remove_map to npc_unload
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11036 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index b5fc1cacf..352161189 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1441,9 +1441,6 @@ int npc_remove_map(struct npc_data* nd) if(nd->bl.prev == NULL || nd->bl.m < 0) return 1; //Not assigned to a map. m = nd->bl.m; -#ifdef PCRE_SUPPORT - npc_chat_finalize(nd); -#endif clif_clearunit_area(&nd->bl,2); //Remove corresponding NPC CELLs if (nd->bl.subtype == WARP) { @@ -1513,6 +1510,10 @@ int npc_unload(struct npc_data* nd) if (nd->chat_id) // remove npc chatroom object and kick users chat_deletenpcchat(nd); +#ifdef PCRE_SUPPORT + npc_chat_finalize(nd); // deallocate npc PCRE data structures +#endif + if (nd->bl.subtype == SCRIPT) { ev_db->foreach(ev_db,npc_unload_ev,nd->exname); //Clean up all events related. if (nd->u.scr.timerid != -1) { |