diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-05-02 17:14:00 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-05-02 17:14:00 +0000 |
commit | df801754db61508ccb447b26f6b2b2aa9a304f9e (patch) | |
tree | c92a997f8327b0256fe665c62ca1b2b35346af18 /src/map/npc.c | |
parent | e67711acbe9d29a2feb9293fccc72cd15603ee76 (diff) | |
download | hercules-df801754db61508ccb447b26f6b2b2aa9a304f9e.tar.gz hercules-df801754db61508ccb447b26f6b2b2aa9a304f9e.tar.bz2 hercules-df801754db61508ccb447b26f6b2b2aa9a304f9e.tar.xz hercules-df801754db61508ccb447b26f6b2b2aa9a304f9e.zip |
* Changes to map_foreach* functions:
- removed the unecessary use of va_copy in map_foreachpc
- applied the same function pattern to map_foreachmob and map_foreachiddb
- created map_foreachnpc
- extended the behaviour of map_foreach* functions to stop iterating when func returns -1
(also added missing changelog entries from ultramage >.>)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12684 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 683be8620..24fe8787b 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1311,15 +1311,14 @@ static int npc_unload_ev(DBKey key, void* data, va_list ap) return 0; } -static int npc_unload_dup_sub(DBKey key, void* data, va_list ap) +static int npc_unload_dup_sub(struct npc_data* nd, va_list args) { - struct npc_data *nd = (struct npc_data *)data; int src_id; - if(nd->bl.type!=BL_NPC || nd->subtype != SCRIPT) + if( nd->subtype != SCRIPT ) return 0; - src_id=va_arg(ap,int); + src_id = va_arg(args, int); if (nd->u.scr.src_id == src_id) npc_unload(nd); return 0; @@ -1328,7 +1327,7 @@ static int npc_unload_dup_sub(DBKey key, void* data, va_list ap) //Removes all npcs that are duplicates of the passed one. [Skotlex] void npc_unload_duplicates(struct npc_data* nd) { - map_foreachiddb(npc_unload_dup_sub,nd->bl.id); + map_foreachnpc(npc_unload_dup_sub,nd->bl.id); } int npc_unload(struct npc_data* nd) |