summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 4cd0f5ce4..11e99d64c 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -245,14 +245,16 @@ void set_char_offline(int char_id, int account_id)
character->waiting_disconnect = -1;
}
- //If user is NOT at char screen, delete entry [Kevin]
- if(character->char_id != -1)
+ if(character->char_id == char_id)
{
- idb_remove(online_char_db, account_id);
+ character->char_id = -1;
+ character->server = -1;
}
+
+ //FIXME? Why Kevin free'd the online information when the char was effectively in the map-server?
}
- if (login_fd > 0 && !session[login_fd]->flag.eof && (char_id == -1 || character == NULL || character->char_id != -1))
+ if (login_fd > 0 && !session[login_fd]->flag.eof && (char_id == -1 || character == NULL || character->fd == -1))
{
WFIFOHEAD(login_fd,6);
WFIFOW(login_fd,0) = 0x272c;
@@ -3218,10 +3220,10 @@ int parse_char(int fd)
if( sd != NULL && sd->auth )
{
struct online_char_data* data = (struct online_char_data*)idb_get(online_char_db, sd->account_id);
- if( data == NULL || data->server == -1) //If it is not in any server, send it offline. [Skotlex]
- set_char_offline(-1,sd->account_id);
if( data != NULL && data->fd == fd)
data->fd = -1;
+ if( data == NULL || data->server == -1) //If it is not in any server, send it offline. [Skotlex]
+ set_char_offline(-1,sd->account_id);
}
do_close(fd);
return 0;