From abd0c3a98bbbe6bcd0425351207120a00babe329 Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 7 Dec 2007 08:44:52 +0000 Subject: - removed the timer heap correction code when the timers overflow since Flavio points out that it is not needed. - Modified a bit the changesex code so you get saved and quit before changing your sex rather than afterwards. - Cleaned up #changesex - Signum Crucis now works on bosses. - party_recv_data will not set the sd pointer for not-yet-authed characters. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11867 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/charcommand.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/map/charcommand.c') diff --git a/src/map/charcommand.c b/src/map/charcommand.c index e44954a4c..5f6fb839e 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -1411,6 +1411,7 @@ int charcommand_stpoint(const int fd, struct map_session_data* sd, const char* c *------------------------------------------*/ int charcommand_changesex(const int fd, struct map_session_data* sd, const char* command, const char* message) { + struct map_session_data *pl_sd; char player[NAME_LENGTH]; nullpo_retr(-1, sd); @@ -1419,18 +1420,17 @@ int charcommand_changesex(const int fd, struct map_session_data* sd, const char* return -1; } - // check player name - if (strlen(player) < 4) { - clif_displaymessage(fd, msg_table[86]); // Sorry, but a player name have at least 4 characters. + if ((pl_sd = map_nick2sd(player)) == NULL) + { + clif_displaymessage(fd, msg_txt(3)); // Character not found. return -1; - } else if (strlen(player) > 23) { - clif_displaymessage(fd, msg_table[87]); // Sorry, but a player name have 23 characters maximum. + } + if (pc_isGM(sd) < pc_isGM(pl_sd)) { + clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. return -1; - } else { - chrif_char_ask_name(sd->status.account_id, player, 5, 0, 0, 0, 0, 0, 0); // type: 5 - changesex - clif_displaymessage(fd, msg_table[88]); // Character name sent to char-server to ask it. } - + clif_displaymessage(fd, msg_table[88]); // Character name sent to char-server to ask it. + chrif_changesex(pl_sd); return 0; } -- cgit v1.2.3-60-g2f50