summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-09 14:31:15 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-09 14:31:15 +0000
commit33369a948f2d6ba2059f81816ea7b16e486090ba (patch)
treeb08a112ecbacf193f3a98c2bcc05a01fddef5feb /src/char/int_guild.c
parent440542802577e5f3f67081803873bc87642a3f48 (diff)
downloadhercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.gz
hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.bz2
hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.xz
hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.zip
Code cleanup: replaced `DBIterator` function calls with macros where possible.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15668 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r--src/char/int_guild.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index d0f41b541..d2e74ee1d 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -49,14 +49,13 @@ static int guild_save_timer(int tid, unsigned int tick, int id, intptr_t data)
{
static int last_id = 0; //To know in which guild we were.
int state = 0; //0: Have not reached last guild. 1: Reached last guild, ready for save. 2: Some guild saved, don't do further saving.
- DBIterator* iter;
+ DBIterator *iter = db_iterator(guild_db_);
DBKey key;
struct guild* g;
if( last_id == 0 ) //Save the first guild in the list.
state = 1;
- iter = guild_db_->iterator(guild_db_);
for( g = (struct guild*)iter->first(iter,&key); iter->exists(iter); g = (struct guild*)iter->next(iter,&key) )
{
if( state == 0 && g->guild_id == last_id )
@@ -79,7 +78,7 @@ static int guild_save_timer(int tid, unsigned int tick, int id, intptr_t data)
db_remove(guild_db_, key);
}
}
- iter->destroy(iter);
+ dbi_destroy(iter);
if( state != 2 ) //Reached the end of the guild db without saving.
last_id = 0; //Reset guild saved, return to beginning.