Fixed unknown map in character select (#3761)
Fixes #1145 Credits to @4144 for finding this! Thanks to @RadianFord for reporting.
This commit is contained in:
parent
ec3b7077cb
commit
1c987de71d
@ -899,7 +899,7 @@ int char_mmo_char_tobuf(uint8* buf, struct mmo_charstatus* p);
|
|||||||
|
|
||||||
//=====================================================================================================
|
//=====================================================================================================
|
||||||
// Loads the basic character rooster for the given account. Returns total buffer used.
|
// Loads the basic character rooster for the given account. Returns total buffer used.
|
||||||
int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) {
|
int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* count ) {
|
||||||
SqlStmt* stmt;
|
SqlStmt* stmt;
|
||||||
struct mmo_charstatus p;
|
struct mmo_charstatus p;
|
||||||
int j = 0, i;
|
int j = 0, i;
|
||||||
@ -992,6 +992,10 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) {
|
|||||||
sd->char_moves[p.slot] = p.character_moves;
|
sd->char_moves[p.slot] = p.character_moves;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( count != nullptr ){
|
||||||
|
*count = i;
|
||||||
|
}
|
||||||
|
|
||||||
memset(sd->new_name,0,sizeof(sd->new_name));
|
memset(sd->new_name,0,sizeof(sd->new_name));
|
||||||
|
|
||||||
SqlStmt_Free(stmt);
|
SqlStmt_Free(stmt);
|
||||||
|
@ -286,7 +286,7 @@ int char_mmo_gender(const struct char_session_data *sd, const struct mmo_charsta
|
|||||||
int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p);
|
int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p);
|
||||||
int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p);
|
int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p);
|
||||||
int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_everything);
|
int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_everything);
|
||||||
int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf);
|
int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* count = nullptr);
|
||||||
enum e_char_del_response char_delete(struct char_session_data* sd, uint32 char_id);
|
enum e_char_del_response char_delete(struct char_session_data* sd, uint32 char_id);
|
||||||
int char_rename_char_sql(struct char_session_data *sd, uint32 char_id);
|
int char_rename_char_sql(struct char_session_data *sd, uint32 char_id);
|
||||||
int char_divorce_char_sql(int partner_id1, int partner_id2);
|
int char_divorce_char_sql(int partner_id1, int partner_id2);
|
||||||
|
@ -372,10 +372,21 @@ void chclif_mmo_send082d(int fd, struct char_session_data* sd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void chclif_mmo_send099d(int fd, struct char_session_data *sd) {
|
void chclif_mmo_send099d(int fd, struct char_session_data *sd) {
|
||||||
|
uint8 count = 0;
|
||||||
|
|
||||||
WFIFOHEAD(fd,4 + (MAX_CHARS*MAX_CHAR_BUF));
|
WFIFOHEAD(fd,4 + (MAX_CHARS*MAX_CHAR_BUF));
|
||||||
WFIFOW(fd,0) = 0x99d;
|
WFIFOW(fd,0) = 0x99d;
|
||||||
WFIFOW(fd,2) = char_mmo_chars_fromsql(sd, WFIFOP(fd,4)) + 4;
|
WFIFOW(fd,2) = char_mmo_chars_fromsql(sd, WFIFOP(fd,4), &count) + 4;
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
|
|
||||||
|
// This is something special Gravity came up with.
|
||||||
|
// The client triggers some finalization code only if count is != 3.
|
||||||
|
if( count == 3 ){
|
||||||
|
WFIFOHEAD(fd,4);
|
||||||
|
WFIFOW(fd,0) = 0x99d;
|
||||||
|
WFIFOW(fd,2) = 4;
|
||||||
|
WFIFOSET(fd,4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user