Follow-up to r14368. Load last_map from SQL on char load so the information is available during char select for PACKETVER > 20100721. Patch based on Ai4rei's. (bugreport:4429)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/renewal@14453 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Paradox924X 2010-11-09 20:17:56 +00:00
parent 187aa99cbf
commit 9730bc0139
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,7 @@
Date Added Date Added
2010/11/09
* Follow-up to r14368. Load last_map from SQL on char load so the information is available during char select for PACKETVER > 20100721. Patch based on Ai4rei's. (bugreport:4429) [Paradox924X]
2010/11/08 2010/11/08
* Notify players involved in a trade that it has been canceled when one player changes maps/logs out or otherwise becomes unable to participate in the trade. [Paradox924X] * Notify players involved in a trade that it has been canceled when one player changes maps/logs out or otherwise becomes unable to participate in the trade. [Paradox924X]
* Send the actual level of the person you're trading with rather than limiting it by the max_lv/aura_lv settings. [Paradox924X] * Send the actual level of the person you're trading with rather than limiting it by the max_lv/aura_lv settings. [Paradox924X]

View File

@ -824,6 +824,7 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
SqlStmt* stmt; SqlStmt* stmt;
struct mmo_charstatus p; struct mmo_charstatus p;
int j = 0, i; int j = 0, i;
char last_map[MAP_NAME_LENGTH_EXT];
stmt = SqlStmt_Malloc(sql_handle); stmt = SqlStmt_Malloc(sql_handle);
if( stmt == NULL ) if( stmt == NULL )
@ -838,7 +839,7 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
"`char_id`,`char_num`,`name`,`class`,`base_level`,`job_level`,`base_exp`,`job_exp`,`zeny`," "`char_id`,`char_num`,`name`,`class`,`base_level`,`job_level`,`base_exp`,`job_exp`,`zeny`,"
"`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`," "`str`,`agi`,`vit`,`int`,`dex`,`luk`,`max_hp`,`hp`,`max_sp`,`sp`,"
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`," "`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`,"
"`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`rename`" "`clothes_color`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`"
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", char_db, sd->account_id, MAX_CHARS) " FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", char_db, sd->account_id, MAX_CHARS)
|| SQL_ERROR == SqlStmt_Execute(stmt) || SQL_ERROR == SqlStmt_Execute(stmt)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
@ -873,7 +874,8 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 29, SQLDT_SHORT, &p.head_top, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 29, SQLDT_SHORT, &p.head_top, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 30, SQLDT_SHORT, &p.head_mid, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 30, SQLDT_SHORT, &p.head_mid, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 31, SQLDT_SHORT, &p.head_bottom, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 31, SQLDT_SHORT, &p.head_bottom, 0, NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 32, SQLDT_SHORT, &p.rename, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 32, SQLDT_STRING, &last_map, sizeof(last_map), NULL, NULL)
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 33, SQLDT_SHORT, &p.rename, 0, NULL, NULL)
) )
{ {
SqlStmt_ShowDebug(stmt); SqlStmt_ShowDebug(stmt);
@ -882,6 +884,7 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
} }
for( i = 0; i < MAX_CHARS && SQL_SUCCESS == SqlStmt_NextRow(stmt); i++ ) for( i = 0; i < MAX_CHARS && SQL_SUCCESS == SqlStmt_NextRow(stmt); i++ )
{ {
p.last_point.map = mapindex_name2id(last_map);
sd->found_char[i] = p.char_id; sd->found_char[i] = p.char_id;
j += mmo_char_tobuf(WBUFP(buf, j), &p); j += mmo_char_tobuf(WBUFP(buf, j), &p);
} }