diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2011-09-10 16:43:26 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2011-09-10 16:43:26 -0700 |
commit | 8f4e4e9a92f6af89820a358ab99b990697117502 (patch) | |
tree | cb312b5367c71dfe89543a5463be9555177c6445 /src/char/int_party.c | |
parent | f841b6fdcc802e73d52da0e67ee192c0c2c1c7e1 (diff) | |
parent | 2c863c0d99aa3df9ef2eb4ceb112c4d946520f0a (diff) | |
download | tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.tar.gz tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.tar.bz2 tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.tar.xz tmwa-8f4e4e9a92f6af89820a358ab99b990697117502.zip |
Merge commit '2c863c0d99aa3df9ef2eb4ceb112c4d946520f0a'
Diffstat (limited to 'src/char/int_party.c')
-rw-r--r-- | src/char/int_party.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c index b728b1e..6f8d023 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -87,7 +87,7 @@ int inter_party_fromstr (char *str, struct party *p) } // パーティデータのロード -int inter_party_init () +int inter_party_init (void) { char line[8192]; struct party *p; @@ -140,11 +140,11 @@ void inter_party_save_sub (db_key_t key, db_val_t data, va_list ap) inter_party_tostr (line, (struct party *) data); fp = va_arg (ap, FILE *); - fprintf (fp, "%s" RETCODE, line); + fprintf (fp, "%s\n", line); } // パーティーデータのセーブ -int inter_party_save () +int inter_party_save (void) { FILE *fp; int lock; @@ -460,9 +460,7 @@ int mapif_parse_CreateParty (int fd, int account_id, char *name, char *nick, // パーティ情報要求 int mapif_parse_PartyInfo (int fd, int party_id) { - struct party *p; - - p = numdb_search (party_db, party_id); + struct party *p = (struct party *)numdb_search (party_db, party_id); if (p != NULL) mapif_party_info (fd, p); else @@ -475,17 +473,14 @@ int mapif_parse_PartyInfo (int fd, int party_id) int mapif_parse_PartyAddMember (int fd, int party_id, int account_id, char *nick, char *map, int lv) { - struct party *p; - int i; - - p = numdb_search (party_db, party_id); + struct party *p = (struct party *)numdb_search (party_db, party_id); if (p == NULL) { mapif_party_memberadded (fd, party_id, account_id, 1); return 0; } - for (i = 0; i < MAX_PARTY; i++) + for (int i = 0; i < MAX_PARTY; i++) { if (p->member[i].account_id == 0) { @@ -519,14 +514,12 @@ int mapif_parse_PartyAddMember (int fd, int party_id, int account_id, int mapif_parse_PartyChangeOption (int fd, int party_id, int account_id, int exp, int item) { - struct party *p; - int flag = 0; - - p = numdb_search (party_db, party_id); + struct party *p = (struct party *)numdb_search (party_db, party_id); if (p == NULL) return 0; p->exp = exp; + int flag = 0; if (exp > 0 && !party_check_exp_share (p)) { flag |= 0x01; @@ -542,13 +535,10 @@ int mapif_parse_PartyChangeOption (int fd, int party_id, int account_id, // パーティ脱退要求 int mapif_parse_PartyLeave (int fd, int party_id, int account_id) { - struct party *p; - int i; - - p = numdb_search (party_db, party_id); + struct party *p = (struct party *)numdb_search (party_db, party_id); if (p != NULL) { - for (i = 0; i < MAX_PARTY; i++) + for (int i = 0; i < MAX_PARTY; i++) { if (p->member[i].account_id == account_id) { @@ -569,14 +559,11 @@ int mapif_parse_PartyLeave (int fd, int party_id, int account_id) int mapif_parse_PartyChangeMap (int fd, int party_id, int account_id, char *map, int online, int lv) { - struct party *p; - int i; - - p = numdb_search (party_db, party_id); + struct party *p = (struct party *)numdb_search (party_db, party_id); if (p == NULL) return 0; - for (i = 0; i < MAX_PARTY; i++) + for (int i = 0; i < MAX_PARTY; i++) { if (p->member[i].account_id == account_id) { @@ -604,9 +591,7 @@ int mapif_parse_PartyChangeMap (int fd, int party_id, int account_id, // パーティ解散要求 int mapif_parse_BreakParty (int fd, int party_id) { - struct party *p; - - p = numdb_search (party_db, party_id); + struct party *p = (struct party *)numdb_search (party_db, party_id); if (p == NULL) return 0; |