summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-11-22 23:54:34 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-11-22 23:54:34 +0000
commit1bb03e1549a9050049bc027566a448a530298b64 (patch)
tree608261af5fedb40990629bf14a434b918afe470b /src/map/party.c
parent69fc1bcd69e4094d5e232acabf2a19376395d501 (diff)
downloadhercules-1bb03e1549a9050049bc027566a448a530298b64.tar.gz
hercules-1bb03e1549a9050049bc027566a448a530298b64.tar.bz2
hercules-1bb03e1549a9050049bc027566a448a530298b64.tar.xz
hercules-1bb03e1549a9050049bc027566a448a530298b64.zip
* Hunted down improper uses of va_list variables.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13383 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/party.c b/src/map/party.c
index a6f2c454f..46ddf2952 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -929,7 +929,6 @@ int party_sub_count(struct block_list *bl, va_list ap)
int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_session_data *sd,int range,...)
{
struct party_data *p;
- va_list ap;
int i;
int x0,y0,x1,y1;
struct block_list *list[MAX_PARTY];
@@ -946,8 +945,6 @@ int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_sess
x1=sd->bl.x+range;
y1=sd->bl.y+range;
- va_start(ap,range);
-
for(i=0;i<MAX_PARTY;i++)
{
struct map_session_data *psd = p->data[i].sd;
@@ -964,10 +961,14 @@ int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_sess
map_freeblock_lock();
for(i=0;i<blockcount;i++)
- total += func(list[i],ap);
+ {
+ va_list ap;
+ va_start(ap, range);
+ total += func(list[i], ap);
+ va_end(ap);
+ }
map_freeblock_unlock();
- va_end(ap);
return total;
}