Bug fixes
Optimized MVP tomb code, thanks ivanyan http://rathena.org/board/tracker/issue-8159-mvptomb-destroy-not-efficient-code/ Fixed quest status display, thanks reigneil Credit to malufett http://rathena.org/board/tracker/issue-7175-bug-in-all-quests/ Fixed @autotrade persistency problems: Changed truncate to delete Fixed sex problems
This commit is contained in:
@@ -172,23 +172,8 @@ void mvptomb_destroy(struct mob_data *md) {
|
||||
struct npc_data *nd;
|
||||
|
||||
if ( (nd = map_id2nd(md->tomb_nid)) ) {
|
||||
int16 m, i;
|
||||
|
||||
m = nd->bl.m;
|
||||
|
||||
clif_clearunit_area(&nd->bl,CLR_OUTSIGHT);
|
||||
|
||||
map_delblock(&nd->bl);
|
||||
|
||||
ARR_FIND( 0, map[m].npc_num, i, map[m].npc[i] == nd );
|
||||
if( !(i == map[m].npc_num) ) {
|
||||
map[m].npc_num--;
|
||||
map[m].npc[i] = map[m].npc[map[m].npc_num];
|
||||
map[m].npc[map[m].npc_num] = NULL;
|
||||
}
|
||||
|
||||
npc_remove_map(nd);
|
||||
map_deliddb(&nd->bl);
|
||||
|
||||
aFree(nd);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,11 +50,17 @@ int quest_search_db(int quest_id)
|
||||
//Send quest info on login
|
||||
int quest_pc_login(TBL_PC * sd)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(sd->avail_quests == 0)
|
||||
return 1;
|
||||
|
||||
clif_quest_send_list(sd);
|
||||
clif_quest_send_mission(sd);
|
||||
|
||||
for( i = 0; i < sd->avail_quests; i++ ){
|
||||
clif_quest_update_objective(sd, &sd->quest_log[i], sd->quest_index[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -99,6 +105,8 @@ int quest_add(TBL_PC * sd, int quest_id)
|
||||
|
||||
clif_quest_add(sd, &sd->quest_log[i], sd->quest_index[i]);
|
||||
|
||||
clif_quest_update_objective(sd, &sd->quest_log[i], sd->quest_index[i]);
|
||||
|
||||
if( save_settings&64 )
|
||||
chrif_save(sd,0);
|
||||
|
||||
@@ -147,6 +155,8 @@ int quest_change(TBL_PC * sd, int qid1, int qid2)
|
||||
clif_quest_delete(sd, qid1);
|
||||
clif_quest_add(sd, &sd->quest_log[i], sd->quest_index[i]);
|
||||
|
||||
clif_quest_update_objective(sd, &sd->quest_log[i], sd->quest_index[i]);
|
||||
|
||||
if( save_settings&64 )
|
||||
chrif_save(sd,0);
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
|
||||
|
||||
Sql_EscapeString( mmysql_handle, message_sql, sd->message );
|
||||
|
||||
if( Sql_Query( mmysql_handle, "INSERT INTO `%s`(`id`,`account_id`,`char_id`,`sex`,`map`,`x`,`y`,`title`,`autotrade`) VALUES( %d, %d, %d, '%c', '%s', %d, %d, '%s', %d );", vendings_db, sd->vender_id, sd->status.account_id, sd->status.char_id, sd->status.sex == 2 ? 'F' : 'M', map[sd->bl.m].name, sd->bl.x, sd->bl.y, message_sql, sd->state.autotrade ) != SQL_SUCCESS ){
|
||||
if( Sql_Query( mmysql_handle, "INSERT INTO `%s`(`id`,`account_id`,`char_id`,`sex`,`map`,`x`,`y`,`title`,`autotrade`) VALUES( %d, %d, %d, '%c', '%s', %d, %d, '%s', %d );", vendings_db, sd->vender_id, sd->status.account_id, sd->status.char_id, sd->status.sex == 0 ? 'F' : 'M', map[sd->bl.m].name, sd->bl.x, sd->bl.y, message_sql, sd->state.autotrade ) != SQL_SUCCESS ){
|
||||
Sql_ShowDebug(mmysql_handle);
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ void do_init_vending_autotrade( void ){
|
||||
// initialize player
|
||||
CREATE(vending->sd, TBL_PC, 1);
|
||||
|
||||
pc_setnewpc( vending->sd, vending->account_id, vending->char_id, 0, gettick(), vending->sex, 0 );
|
||||
pc_setnewpc( vending->sd, vending->account_id, vending->char_id, 0, gettick(), vending->sex == 'F' ? 0 : 1, 0 );
|
||||
|
||||
vending->sd->state.autotrade = 1;
|
||||
|
||||
@@ -631,8 +631,8 @@ void do_init_vending_autotrade( void ){
|
||||
}
|
||||
|
||||
// Everything is loaded fine, their entries will be reinserted once they are loaded
|
||||
if( Sql_Query( mmysql_handle, "TRUNCATE TABLE `%s`;", vendings_db ) != SQL_SUCCESS ||
|
||||
Sql_Query( mmysql_handle, "TRUNCATE TABLE `%s`;", vending_items_db ) != SQL_SUCCESS ){
|
||||
if( Sql_Query( mmysql_handle, "DELETE FROM `%s`;", vendings_db ) != SQL_SUCCESS ||
|
||||
Sql_Query( mmysql_handle, "DELETE FROM `%s`;", vending_items_db ) != SQL_SUCCESS ){
|
||||
Sql_ShowDebug(mmysql_handle);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user