summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-03-30 23:08:28 -0300
committershennetsind <ind@henn.et>2013-03-30 23:08:28 -0300
commitff04c3ff3b41eb5bbf81278fd23e70b6455aa732 (patch)
treec86a4bc876e20ee309b083cb547a2c15a426eecd /src
parent7ec1e8fdff6adad1979d750774f9003f223bf3ef (diff)
parente66463494c02b61b38dd256827f796640acfce6d (diff)
downloadhercules-ff04c3ff3b41eb5bbf81278fd23e70b6455aa732.tar.gz
hercules-ff04c3ff3b41eb5bbf81278fd23e70b6455aa732.tar.bz2
hercules-ff04c3ff3b41eb5bbf81278fd23e70b6455aa732.tar.xz
hercules-ff04c3ff3b41eb5bbf81278fd23e70b6455aa732.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-rw-r--r--src/char/pincode.c22
-rw-r--r--src/map/skill.c2
2 files changed, 9 insertions, 15 deletions
diff --git a/src/char/pincode.c b/src/char/pincode.c
index b68c4e38a..4135c0c1c 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -28,7 +28,7 @@ void pincode_handle ( int fd, struct char_session_data* sd ) {
return;
}
- if( strlen(sd->pincode) ){
+ if( strlen(sd->pincode) == 4 ){
if( *pincode->changetime && time(NULL) > (sd->pincode_change+*pincode->changetime) ){ // User hasnt changed his PIN code for a long time
pincode->sendstate( fd, sd, PINCODE_EXPIRED );
} else { // Ask user for his PIN code
@@ -69,33 +69,27 @@ int pincode_compare(int fd, struct char_session_data* sd, char* pin) {
void pincode_change(int fd, struct char_session_data* sd) {
char oldpin[5] = "\0\0\0\0", newpin[5] = "\0\0\0\0";
- struct online_char_data* character;
- strncpy(oldpin, (char*)RFIFOP(fd,6), 4+1);
+ strncpy(oldpin, (char*)RFIFOP(fd,6), sizeof(oldpin));
pincode->decrypt(sd->pincode_seed,oldpin);
if( !pincode->compare( fd, sd, oldpin ) )
return;
- strncpy(newpin, (char*)RFIFOP(fd,10), 3+1);
+ strncpy(newpin, (char*)RFIFOP(fd,10), sizeof(newpin));
pincode->decrypt(sd->pincode_seed,newpin);
pincode->update( sd->account_id, newpin );
- if( (character = (struct online_char_data*)idb_get(online_char_db, sd->account_id)) )
- character->pincode_enable = *pincode->charselect * 2;
- pincode->sendstate( fd, sd, PINCODE_OK );
+ strncpy(sd->pincode, newpin, sizeof(sd->pincode));
+ pincode->sendstate( fd, sd, PINCODE_ASK );
}
void pincode_setnew(int fd, struct char_session_data* sd) {
char newpin[5] = "\0\0\0\0";
- struct online_char_data* character;
- strncpy(newpin, (char*)RFIFOP(fd,6), 4+1);
+ strncpy(newpin, (char*)RFIFOP(fd,6), sizeof(newpin));
pincode->decrypt(sd->pincode_seed,newpin);
-
pincode->update( sd->account_id, newpin );
-
- pincode->sendstate( fd, sd, PINCODE_OK );
- if( (character = (struct online_char_data*)idb_get(online_char_db, sd->account_id)) )
- character->pincode_enable = *pincode->charselect * 2;
+ strncpy(sd->pincode, newpin, sizeof(sd->pincode));
+ pincode->sendstate( fd, sd, PINCODE_ASK );
}
// 0 = pin is correct
diff --git a/src/map/skill.c b/src/map/skill.c
index d6b06256e..77c5f99a2 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -13706,7 +13706,7 @@ int skill_vfcastfix (struct block_list *bl, double time, uint16 skill_id, uint16
return 0;
if( bl->type == BL_MOB ) // mobs casttime is fixed nothing to alter.
- return time;
+ return (int)time;
if( fixed == 0 ){
fixed = (int)time * 20 / 100; // fixed time