diff options
author | Fate <fate-tmw@googlemail.com> | 2009-05-14 10:20:57 +0000 |
---|---|---|
committer | Fate <fate-tmw@googlemail.com> | 2009-05-14 10:20:57 +0000 |
commit | 4e7a458308e2c3c6670489da43d06bd25c2db92c (patch) | |
tree | a24e10e4e4a7c2bfc2c298b85440347816cc04a7 /src | |
parent | 226d345c10e5271f026584083090e46ebc580f3e (diff) | |
download | tmwa-4e7a458308e2c3c6670489da43d06bd25c2db92c.tar.gz tmwa-4e7a458308e2c3c6670489da43d06bd25c2db92c.tar.bz2 tmwa-4e7a458308e2c3c6670489da43d06bd25c2db92c.tar.xz tmwa-4e7a458308e2c3c6670489da43d06bd25c2db92c.zip |
Added pc_logout() hook to process players who are logging out
When poisoned and logging out, set hp to 1 to avoid cheap poison cure exploit
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 1 | ||||
-rw-r--r-- | src/map/pc.c | 11 | ||||
-rw-r--r-- | src/map/pc.h | 1 |
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); |