summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/clif.c1
-rw-r--r--src/map/pc.c11
-rw-r--r--src/map/pc.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e5fa002..ba9f6a5 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8351,6 +8351,7 @@ static int clif_parse(int fd) {
// �ڑ����؂��Ă��̂Ō��n��
if (!chrif_isconnect() || session[fd]->eof) { // char�I�Ɍq����ĂȂ��Ԃ͐ڑ��֎~ (!chrif_isconnect())
if (sd && sd->state.auth) {
+ pc_logout(sd);
clif_quitsave(fd, sd);
if (sd->status.name != NULL)
printf("Player [%s] has logged off your server.\n", sd->status.name); // Player logout display [Valaris]
diff --git a/src/map/pc.c b/src/map/pc.c
index 8933000..64e66d7 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7704,3 +7704,14 @@ pc_invisibility(struct map_session_data *sd, int enabled)
pc_setpos(sd, map[sd->bl.m].name, sd->bl.x, sd->bl.y, 3);
}
}
+
+int pc_logout(struct map_session_data *sd) // [fate] Player logs out
+{
+ if (!sd)
+ return 0;
+
+ if (sd->sc_data[SC_POISON].timer != -1)
+ sd->status.hp = 1; // Logging out while poisoned -> bad
+
+ return 0;
+}
diff --git a/src/map/pc.h b/src/map/pc.h
index 8ecbeb3..0af9a20 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -184,6 +184,7 @@ int pc_setinvincibletimer(struct map_session_data *sd,int);
int pc_delinvincibletimer(struct map_session_data *sd);
int pc_addspiritball(struct map_session_data *sd,int,int);
int pc_delspiritball(struct map_session_data *sd,int,int);
+int pc_logout(struct map_session_data *sd); // [fate] Player logs out
int do_init_pc(void);