diff options
author | toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-21 16:19:25 +0000 |
---|---|---|
committer | toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-21 16:19:25 +0000 |
commit | e8b3eecf9e259b11fc01e3856df14ddd77b5d631 (patch) | |
tree | 95d613d71f84038d1d8611c139b0f154236267d5 | |
parent | 51fe7bd67c35e60e46ea47d485f25eaefccc87a6 (diff) | |
download | hercules-e8b3eecf9e259b11fc01e3856df14ddd77b5d631.tar.gz hercules-e8b3eecf9e259b11fc01e3856df14ddd77b5d631.tar.bz2 hercules-e8b3eecf9e259b11fc01e3856df14ddd77b5d631.tar.xz hercules-e8b3eecf9e259b11fc01e3856df14ddd77b5d631.zip |
Made some cleanup in changesex
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12626 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/char/char.c | 2 | ||||
-rw-r--r-- | src/char_sql/char.c | 2 | ||||
-rw-r--r-- | src/map/chrif.c | 6 | ||||
-rw-r--r-- | src/map/script.c | 12 |
5 files changed, 9 insertions, 14 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 6e71bd382..af0099ce6 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2008/04/19 + * Made some cleanup in changesex [Toms] * Fixed a bug in (init/start/stop)npctimer [Toms] 2008/04/18 * Fixed a bug when unloading a npc near a shop. diff --git a/src/char/char.c b/src/char/char.c index 76312ac0d..5d3975816 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3000,7 +3000,7 @@ int parse_frommap(int fd) } // send answer if a player ask, not if the server ask - if( acc != -1 ) { + if( acc != -1 && type != 5) { // Don't send answer for changesex WFIFOHEAD(fd,34); WFIFOW(fd, 0) = 0x2b0f; WFIFOL(fd, 2) = acc; diff --git a/src/char_sql/char.c b/src/char_sql/char.c index e07bd8574..8066dc629 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -2599,7 +2599,7 @@ int parse_frommap(int fd) Sql_FreeResult(sql_handle); // send answer if a player ask, not if the server ask - if( acc != -1 ) { + if( acc != -1 && type != 5) { // Don't send answer for changesex WFIFOHEAD(fd,34); WFIFOW(fd, 0) = 0x2b0f; WFIFOL(fd, 2) = acc; diff --git a/src/map/chrif.c b/src/map/chrif.c index a2604dcf3..7ca140159 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -786,7 +786,11 @@ int chrif_changesex(struct map_session_data *sd) WFIFOSET(char_fd,44); clif_displaymessage(sd->fd, "Need disconnection to perform change-sex request..."); - map_quit(sd); + + if (sd->fd) + clif_authfail_fd(sd->fd, 15); + else + map_quit(sd); return 0; } diff --git a/src/map/script.c b/src/map/script.c index 44cf4e37b..364dbc8b9 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8506,17 +8506,7 @@ BUILDIN_FUNC(changesex) TBL_PC *sd = NULL; sd = script_rid2sd(st); - if (sd->status.sex == 0) { - sd->status.sex = 1; - if ((sd->class_&MAPID_UPPERMASK) == MAPID_BARDDANCER) - sd->status.class_ -= 1; - } else if (sd->status.sex == 1) { - sd->status.sex = 0; - if ((sd->class_&MAPID_UPPERMASK) == MAPID_BARDDANCER) - sd->status.class_ += 1; - } - chrif_char_ask_name(-1, sd->status.name, 5, 0, 0, 0, 0, 0, 0); // type: 5 - changesex - chrif_save(sd,0); + chrif_changesex(sd); return 0; } |