Fixed returned mails from deleted chars (#7181)
Fixes #7161 Thanks to @Pokye
This commit is contained in:
parent
df9ef6fa79
commit
a88e25a8e3
7
sql-files/upgrades/upgrade_20220818.sql
Normal file
7
sql-files/upgrades/upgrade_20220818.sql
Normal file
@ -0,0 +1,7 @@
|
||||
UPDATE `mail`
|
||||
SET `send_id`='0'
|
||||
WHERE `send_id` NOT IN (
|
||||
select `char_id`
|
||||
from `char`
|
||||
)
|
||||
;
|
@ -1729,6 +1729,10 @@ enum e_char_del_response char_delete(struct char_session_data* sd, uint32 char_i
|
||||
if (SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `dest_id`='%d'", schema_config.mail_db, char_id))
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
/* mark mails as sent from server, if a character gets deleted */
|
||||
if (SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `send_id`='0' WHERE `send_id`='%d'", schema_config.mail_db, char_id))
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
#ifdef ENABLE_SC_SAVING
|
||||
/* status changes */
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `account_id` = '%d' AND `char_id`='%d'", schema_config.scdata_db, account_id, char_id) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user