summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-03-16 10:13:03 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-03-16 10:13:03 +0800
commitf214021bb14aa3ab976730b32dd79d843ff8e93e (patch)
treef44f07da3c31f44117de809cbafbec7baf635367 /src/char/char.c
parent84e8f1872f0f00d6f82d6fe85974bb1f37247c53 (diff)
downloadhercules-f214021bb14aa3ab976730b32dd79d843ff8e93e.tar.gz
hercules-f214021bb14aa3ab976730b32dd79d843ff8e93e.tar.bz2
hercules-f214021bb14aa3ab976730b32dd79d843ff8e93e.tar.xz
hercules-f214021bb14aa3ab976730b32dd79d843ff8e93e.zip
Follow up fixed for Pin Code Feature
-Fixed some warning in Windows. -Fixed 'pincode_charselect' where it doesn't work properly Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 3436860d0..9e63a682c 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -186,6 +186,7 @@ static DBData create_online_char_data(DBKey key, va_list args)
character->account_id = key.i;
character->char_id = -1;
character->server = -1;
+ character->pincode_enable = -1;
character->fd = -1;
character->waiting_disconnect = INVALID_TIMER;
return db_ptr2data(character);
@@ -203,6 +204,8 @@ void set_char_charselect(int account_id)
character->char_id = -1;
character->server = -1;
+ if(character->pincode_enable == -1)
+ character->pincode_enable = *pincode->charselect + *pincode->enabled;
if(character->waiting_disconnect != INVALID_TIMER) {
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
@@ -299,6 +302,7 @@ void set_char_offline(int char_id, int account_id)
{
character->char_id = -1;
character->server = -1;
+ character->pincode_enable = -1;
}
//FIXME? Why Kevin free'd the online information when the char was effectively in the map-server?
@@ -4167,10 +4171,8 @@ int parse_char(int fd)
if( RFIFOREST(fd) < 10 )
return 0;
- if( !sd->pincode_pass ) {
- if( RFIFOL(fd,2) == sd->account_id )
- pincode->check( fd, sd );
- }
+ if( RFIFOL(fd,2) == sd->account_id )
+ pincode->check( fd, sd );
RFIFOSKIP(fd,10);
break;
@@ -4180,7 +4182,7 @@ int parse_char(int fd)
if( RFIFOREST(fd) < 6 )
return 0;
if( RFIFOL(fd,2) == sd->account_id )
- pincode->state( fd, sd, PINCODE_NOTSET );
+ pincode->sendstate( fd, sd, PINCODE_NOTSET );
RFIFOSKIP(fd,6);
break;
@@ -4189,10 +4191,8 @@ int parse_char(int fd)
case 0x8be:
if( RFIFOREST(fd) < 14 )
return 0;
- if( !sd->pincode_pass ) {
- if( RFIFOL(fd,2) == sd->account_id )
- pincode->change( fd, sd );
- }
+ if( RFIFOL(fd,2) == sd->account_id )
+ pincode->change( fd, sd );
RFIFOSKIP(fd,14);
break;
@@ -4201,10 +4201,8 @@ int parse_char(int fd)
case 0x8ba:
if( RFIFOREST(fd) < 10 )
return 0;
- if( !sd->pincode_pass ) {
- if( RFIFOL(fd,2) == sd->account_id )
- pincode->new( fd, sd );
- }
+ if( RFIFOL(fd,2) == sd->account_id )
+ pincode->setnew( fd, sd );
RFIFOSKIP(fd,10);
break;