From 5fa2db993dfbe81162e976cd1af54917c1ff3a21 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Tue, 28 Mar 2017 19:36:40 +0200 Subject: [PATCH] Fixed #2028 --- src/char/char_clif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/char/char_clif.c b/src/char/char_clif.c index 7edfefb82d..aec836160b 100644 --- a/src/char/char_clif.c +++ b/src/char/char_clif.c @@ -800,7 +800,8 @@ int chclif_parse_charselect(int fd, struct char_session_data* sd,uint32 ipl){ int slot = RFIFOB(fd,2); RFIFOSKIP(fd,3); - if ( SQL_SUCCESS != Sql_Query(sql_handle, "SELECT `char_id` FROM `%s` WHERE `account_id`='%d' AND `char_num`='%d'", schema_config.char_db, sd->account_id, slot) + // Check if the character exists and is not scheduled for deletion + if ( SQL_SUCCESS != Sql_Query(sql_handle, "SELECT `char_id` FROM `%s` WHERE `account_id`='%d' AND `char_num`='%d' AND `delete_time` = 0", schema_config.char_db, sd->account_id, slot) || SQL_SUCCESS != Sql_NextRow(sql_handle) || SQL_SUCCESS != Sql_GetData(sql_handle, 0, &data, NULL) ) { //Not found?? May be forged packet.