- Corrected the homunculus deletion functions so that the homunculus is deleted together with the character.
- Added npc_check_areanpc so that Wand of Hermod will correctly check for nearby warps. - Emergency avoid now stacks with other speed boost statuses - Item skills and skills that bring up a menu now are cleared on death. - Minor cleanings git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9742 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
@@ -1455,9 +1455,9 @@ int make_new_char_sql(int fd, unsigned char *dat) {
|
||||
int delete_char_sql(int char_id, int partner_id)
|
||||
{
|
||||
char char_name[NAME_LENGTH], t_name[NAME_LENGTH*2]; //Name needs be escaped.
|
||||
int account_id=0, party_id=0, guild_id=0, char_base_level=0;
|
||||
int account_id, party_id, guild_id, hom_id, char_base_level;
|
||||
|
||||
sprintf(tmp_sql, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level` FROM `%s` WHERE `char_id`='%d'",char_db, char_id);
|
||||
sprintf(tmp_sql, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`hom_id` FROM `%s` WHERE `char_id`='%d'",char_db, char_id);
|
||||
|
||||
if (mysql_query(&mysql_handle, tmp_sql)) {
|
||||
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
|
||||
@@ -1483,6 +1483,7 @@ int delete_char_sql(int char_id, int partner_id)
|
||||
party_id = atoi(sql_row[2]);
|
||||
guild_id = atoi(sql_row[3]);
|
||||
char_base_level = atoi(sql_row[4]);
|
||||
hom_id = atoi(sql_row[5]);
|
||||
mysql_free_result(sql_res); //Let's free this as soon as possible to avoid problems later on.
|
||||
|
||||
//check for config char del condition [Lupus]
|
||||
@@ -1545,6 +1546,10 @@ int delete_char_sql(int char_id, int partner_id)
|
||||
}
|
||||
}
|
||||
|
||||
/* remove homunculus */
|
||||
if (hom_id)
|
||||
inter_delete_homunculus(hom_id);
|
||||
|
||||
/* delete char's friends list */
|
||||
sprintf(tmp_sql, "DELETE FROM `%s` WHERE `char_id` = '%d'",friend_db, char_id);
|
||||
if(mysql_query(&mysql_handle, tmp_sql)) {
|
||||
|
||||
@@ -212,27 +212,33 @@ int mapif_load_homunculus(int fd){
|
||||
return mapif_info_homunculus(fd, RFIFOL(fd,2), homun_pt);
|
||||
}
|
||||
|
||||
|
||||
int inter_delete_homunculus(int hom_id)
|
||||
{
|
||||
sprintf(tmp_sql, "DELETE FROM `homunculus` WHERE `homun_id` = '%u'", hom_id);
|
||||
if(mysql_query(&mysql_handle, tmp_sql))
|
||||
{
|
||||
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
|
||||
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
|
||||
mapif_homunculus_deleted(fd, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sprintf(tmp_sql, "DELETE FROM `skill_homunculus` WHERE `homun_id` = '%u'", hom_id);
|
||||
if(mysql_query(&mysql_handle, tmp_sql))
|
||||
{
|
||||
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
|
||||
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
|
||||
mapif_homunculus_deleted(fd, 0);
|
||||
return 0;
|
||||
}
|
||||
mapif_homunculus_deleted(fd, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int mapif_delete_homunculus(int fd)
|
||||
{
|
||||
RFIFOHEAD(fd);
|
||||
sprintf(tmp_sql, "DELETE FROM `homunculus` WHERE `homun_id` = '%u'", RFIFOL(fd,2));
|
||||
if(mysql_query(&mysql_handle, tmp_sql))
|
||||
{
|
||||
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
|
||||
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
|
||||
return mapif_homunculus_deleted(fd, 0);
|
||||
}
|
||||
|
||||
sprintf(tmp_sql, "DELETE FROM `skill_homunculus` WHERE `homun_id` = '%u'", RFIFOL(fd,2));
|
||||
if(mysql_query(&mysql_handle, tmp_sql))
|
||||
{
|
||||
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
|
||||
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
|
||||
return mapif_homunculus_deleted(fd, 0);
|
||||
}
|
||||
return mapif_homunculus_deleted(fd, 1);
|
||||
inter_delete_homunculus(RFIFOL(fd,2));
|
||||
}
|
||||
|
||||
int mapif_rename_homun_ack(int fd, int account_id, int char_id, unsigned char flag, char *name){
|
||||
|
||||
@@ -9,6 +9,7 @@ void inter_homunculus_sql_final(void);
|
||||
int mapif_save_homunculus(struct s_homunculus *hd);
|
||||
int mapif_load_homunculus(int fd);
|
||||
int mapif_delete_homunculus(int fd);
|
||||
int inter_delete_homunculus(int hom_id);
|
||||
int inter_homunculus_parse_frommap(int fd);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user