summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-22 08:59:49 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-22 08:59:49 +0000
commit5f8d640fcb659e17ccdd198c5c5f04a4b975c472 (patch)
treea7d2eac033f2ef09d8f7064c57e127195996d473 /src/char_sql
parent6675202f30359f4d87ad86513858bd32b4f23b9a (diff)
downloadhercules-5f8d640fcb659e17ccdd198c5c5f04a4b975c472.tar.gz
hercules-5f8d640fcb659e17ccdd198c5c5f04a4b975c472.tar.bz2
hercules-5f8d640fcb659e17ccdd198c5c5f04a4b975c472.tar.xz
hercules-5f8d640fcb659e17ccdd198c5c5f04a4b975c472.zip
Fixed character delayed deletion method, bugreport:5136
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15205 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c5
1 files changed, 5 insertions, 0 deletions
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);