summaryrefslogtreecommitdiff
path: root/src/map/party.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/map/party.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/map/party.c')
-rw-r--r--src/map/party.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 8f8a0cd8a..52be4e807 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -132,13 +132,13 @@ struct party_data* party_searchname(const char* str)
{
struct party_data* p;
- DBIterator* iter = party_db->iterator(party_db);
- for( p = (struct party_data*)iter->first(iter,NULL); iter->exists(iter); p = (struct party_data*)iter->next(iter,NULL) )
+ DBIterator *iter = db_iterator(party_db);
+ for( p = dbi_first(iter); dbi_exists(iter); p = dbi_next(iter) )
{
if( strncmpi(p->party.name,str,NAME_LENGTH) == 0 )
break;
}
- iter->destroy(iter);
+ dbi_destroy(iter);
return p;
}
@@ -864,9 +864,9 @@ int party_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data)
{
struct party_data* p;
- DBIterator* iter = party_db->iterator(party_db);
+ DBIterator *iter = db_iterator(party_db);
// for each existing party,
- for( p = (struct party_data*)iter->first(iter,NULL); iter->exists(iter); p = (struct party_data*)iter->next(iter,NULL) )
+ for( p = dbi_first(iter); dbi_exists(iter); p = dbi_next(iter) )
{
int i;
@@ -894,7 +894,7 @@ int party_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data)
}
}
}
- iter->destroy(iter);
+ dbi_destroy(iter);
return 0;
}
@@ -1217,11 +1217,11 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
int i, count=0;
struct party_booking_ad_info* result_list[PARTY_BOOKING_RESULTS];
bool more_result = false;
- DBIterator* iter = party_booking_db->iterator(party_booking_db);
+ DBIterator* iter = db_iterator(party_booking_db);
memset(result_list, 0, sizeof(result_list));
- for( pb_ad = (struct party_booking_ad_info*)iter->first(iter,NULL); iter->exists(iter); pb_ad = (struct party_booking_ad_info*)iter->next(iter,NULL) )
+ for( pb_ad = dbi_first(iter); dbi_exists(iter); pb_ad = dbi_next(iter) )
{
if (pb_ad->index < lastindex || (level && (pb_ad->p_detail.level < level-15 || pb_ad->p_detail.level > level)))
continue;
@@ -1244,7 +1244,7 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
count++;
}
}
- iter->destroy(iter);
+ dbi_destroy(iter);
clif_PartyBookingSearchAck(sd->fd, result_list, count, more_result);
}