From 5f8d640fcb659e17ccdd198c5c5f04a4b975c472 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 22 Dec 2011 08:59:49 +0000 Subject: Fixed character delayed deletion method, bugreport:5136 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15205 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/char.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/char_sql') diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 410f813e3..49fc3f2fc 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -195,6 +195,7 @@ struct online_char_data { static DBMap* online_char_db; // int account_id -> struct online_char_data* static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr_t data); +int delete_char_sql(int char_id); static void* create_online_char_data(DBKey key, va_list args) { @@ -934,6 +935,10 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf) } for( i = 0; i < MAX_CHARS && SQL_SUCCESS == SqlStmt_NextRow(stmt); i++ ) { + if( p.delete_date && p.delete_date < time(NULL) ) { + delete_char_sql(p.char_id); + continue; + } p.last_point.map = mapindex_name2id(last_map); sd->found_char[i] = p.char_id; j += mmo_char_tobuf(WBUFP(buf, j), &p); -- cgit v1.2.3-70-g09d2