summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-05-06 17:54:15 +0200
committerGitHub <noreply@github.com>2018-05-06 17:54:15 +0200
commit141df5f2f9421851fb974bf89e1fe5d58a4c61a8 (patch)
treeb81f59a4d4c4f17e05c462bb9a537108cb5173f7
parentb889108f6dea3e1765681b9eaf4a39a18c24eeec (diff)
parentfa5cc0300a337d4bb242fc10f6747fac1f1752c4 (diff)
downloadhercules-141df5f2f9421851fb974bf89e1fe5d58a4c61a8.tar.gz
hercules-141df5f2f9421851fb974bf89e1fe5d58a4c61a8.tar.bz2
hercules-141df5f2f9421851fb974bf89e1fe5d58a4c61a8.tar.xz
hercules-141df5f2f9421851fb974bf89e1fe5d58a4c61a8.zip
Merge pull request #2029 from 4144/pincodefix
Fix pincodes after commit 2a05dbfc2f62c6bbac7983dcec120502914567f1.
-rw-r--r--src/char/pincode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/char/pincode.c b/src/char/pincode.c
index 01c1f482c..73d9809fa 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -82,6 +82,7 @@ void pincode_check(int fd, struct char_session_data* sd)
return;
safestrncpy(pin, RFIFOP(fd, 6), sizeof(pin));
+ pincode->decrypt(sd->pincode_seed, pin);
if (pincode->check_blacklist && pincode->isBlacklisted(pin)) {
pincode->loginstate(fd, sd, PINCODE_LOGIN_RESTRICT_PW);
@@ -205,7 +206,7 @@ void pincode_makestate(int fd, struct char_session_data *sd, enum pincode_make_r
WFIFOHEAD(fd, 8);
WFIFOW(fd, 0) = 0x8bb;
WFIFOW(fd, 2) = state;
- WFIFOW(fd, 4) = 0;
+ WFIFOL(fd, 4) = sd->pincode_seed;
WFIFOSET(fd, 8);
}
@@ -223,7 +224,7 @@ void pincode_editstate(int fd, struct char_session_data *sd, enum pincode_edit_r
WFIFOHEAD(fd, 8);
WFIFOW(fd, 0) = 0x8bf;
WFIFOW(fd, 2) = state;
- WFIFOW(fd, 4) = sd->pincode_seed = rnd() % 0xFFFF;
+ WFIFOL(fd, 4) = sd->pincode_seed = rnd() % 0xFFFF;
WFIFOSET(fd, 8);
}