summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-21 17:49:27 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-21 17:49:27 +0000
commitc465366008394980f67365b1175e86bf48749fdf (patch)
tree89a9bceef6c388936054fc9b63d128278e923d5c /src/char_sql/char.c
parent4f862272ac77d04a9f5d1f680f0df11b0b16d68a (diff)
downloadhercules-c465366008394980f67365b1175e86bf48749fdf.tar.gz
hercules-c465366008394980f67365b1175e86bf48749fdf.tar.bz2
hercules-c465366008394980f67365b1175e86bf48749fdf.tar.xz
hercules-c465366008394980f67365b1175e86bf48749fdf.zip
- Some cleaning to the character deletion code.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9552 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c38
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