Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/char/char.c
- ===================================================================
- --- src/char/char.c (revisão 16496)
- +++ src/char/char.c (cópia de trabalho)
- @@ -3664,6 +3664,12 @@
- break;
- }
- + // Send party to map
- + if( cd->party_id != 0 && !inter_party_update(cd) )
- + {
- + // TODO something went wrong, auto remove from party?
- + }
- +
- //Send player to map
- WFIFOHEAD(fd,28);
- WFIFOW(fd,0) = 0x71;
- Index: src/char/int_party.c
- ===================================================================
- --- src/char/int_party.c (revisão 16496)
- +++ src/char/int_party.c (cópia de trabalho)
- @@ -850,3 +850,32 @@
- idb_remove(party_db_, party_id);
- return 1;
- }
- +
- +
- +/// Updates the party info related to the target character.
- +/// Returns true on success.
- +bool inter_party_update(struct mmo_charstatus* cd)
- +{
- + struct party_data* p;
- + struct party_member* member;
- + int i;
- +
- + if( cd == NULL || cd->party_id == 0 )
- + return false; // character not in a party
- + p = inter_party_fromsql(cd->party_id);
- + if( p == NULL )
- + return false; // invalid party
- + for( i = 0; i <= p->party.count; ++i )
- + {
- + member = &p->party.member[i];
- + if( member->account_id != cd->account_id || member->char_id != cd->char_id )
- + continue;
- + safestrncpy(member->name, cd->name, NAME_LENGTH);
- + member->class_ = cd->class_;
- + member->map = cd->last_point.map;
- + member->lv = cd->base_level;
- + mapif_party_info(-1, &p->party, cd->char_id); // send to all map servers
- + return true; // found and updated
- + }
- + return false; // not found
- +}
- Index: src/char/int_party.h
- ===================================================================
- --- src/char/int_party.h (revisão 16496)
- +++ src/char/int_party.h (cópia de trabalho)
- @@ -15,6 +15,7 @@
- };
- struct party;
- +struct mmo_charstatus;
- int inter_party_parse_frommap(int fd);
- int inter_party_sql_init(void);
- @@ -22,6 +23,8 @@
- int inter_party_leave(int party_id,int account_id, int char_id);
- int inter_party_CharOnline(int char_id, int party_id);
- int inter_party_CharOffline(int char_id, int party_id);
- +bool inter_party_update(struct mmo_charstatus* cd);
- +
- //Required for the TXT->SQL converter
- int inter_party_tosql(struct party *p, int flag, int index);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement