diff options
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r-- | src/char_sql/char.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 2a42ecc7f..77e72805d 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -3494,34 +3494,21 @@ int parse_char(int fd) { WFIFOHEAD(fd, 46); ShowInfo(CL_RED" Request Char Deletion:"CL_GREEN"%d (%d)"CL_RESET"\n", sd->account_id, cid); memcpy(email, RFIFOP(fd,6), 40); + RFIFOSKIP(fd, 46); /* Check if e-mail is correct */ - if(strcmpi(email, sd->email)){ - if(strcmp("a@a.com", sd->email) == 0){ - if(strcmp("a@a.com", email) == 0 || strcmp("", email) == 0){ - //ignore - }else{ - //del fail - WFIFOW(fd, 0) = 0x70; - WFIFOB(fd, 2) = 0; - WFIFOSET(fd, 3); - RFIFOSKIP(fd, 46); - break; - } - }else{ - //del fail - WFIFOW(fd, 0) = 0x70; - WFIFOB(fd, 2) = 0; - WFIFOSET(fd, 3); - RFIFOSKIP(fd, 46); - break; - } + if(strcmpi(email, sd->email) && //email does not matches and + ( + strcmp("a@a.com", sd->email) || //it is not default email, or + (strcmp("a@a.com", email) && strcmp("", email)) //email sent does not matches default + )) { //Fail + WFIFOW(fd, 0) = 0x70; + WFIFOB(fd, 2) = 0; + WFIFOSET(fd, 3); + break; } for(i = 0; i < 9; i++) { - /* Debug: - printf("Checking if char to be deleted: %d - %d (%d)\n", sd->found_char[i], RFIFOL(fd, 2), sd->account_id); - */ if (sd->found_char[i] == cid) { for(ch = i; ch < 9-1; ch++) sd->found_char[ch] = sd->found_char[ch+1]; @@ -3564,13 +3551,12 @@ int parse_char(int fd) { WFIFOW(fd, 0) = 0x70; WFIFOB(fd, 2) = 0; WFIFOSET(fd, 3); - RFIFOSKIP(fd, 46); break; } if (char_pid != 0) { /* If there is partner, tell map server to do divorce */ WBUFW(buf,0) = 0x2b12; - WBUFL(buf,2) = RFIFOL(fd,2); + WBUFL(buf,2) = cid; WBUFL(buf,6) = char_pid; mapif_sendall(buf,10); } @@ -3578,8 +3564,6 @@ int parse_char(int fd) { /* Char successfully deleted.*/ WFIFOW(fd, 0) = 0x6f; WFIFOSET(fd, 2); - - RFIFOSKIP(fd, 46); break; } case 0x2af8: // login as map-server |