diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 25 | ||||
-rw-r--r-- | src/char/int_guild.c | 2 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/char/char.c b/src/char/char.c index 09f74034c..d05d13d4b 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2637,11 +2637,11 @@ int char_parse_fromlogin(int fd) { } } - while(RFIFOREST(fd) >= 2) { + while (RFIFOREST(fd) >= 2) { uint16 command = RFIFOW(fd,0); if (VECTOR_LENGTH(HPM->packets[hpParse_FromLogin]) > 0) { - int result = HPM->parse_packets(fd,hpParse_FromLogin); + int result = HPM->parse_packets(fd,command,hpParse_FromLogin); if (result == 1) continue; if (result == 2) @@ -3926,16 +3926,17 @@ int char_parse_frommap(int fd) return 0; } - while(RFIFOREST(fd) >= 2) { + while (RFIFOREST(fd) >= 2) { + int packet_id = RFIFOW(fd,0); if (VECTOR_LENGTH(HPM->packets[hpParse_FromMap]) > 0) { - int result = HPM->parse_packets(fd,hpParse_FromMap); + int result = HPM->parse_packets(fd,packet_id,hpParse_FromMap); if (result == 1) continue; if (result == 2) return 0; } - switch(RFIFOW(fd,0)) { + switch (packet_id) { case 0x2b0a: if( RFIFOREST(fd) < RFIFOW(fd, 2) ) return 0; @@ -5106,21 +5107,21 @@ int char_parse_char(int fd) return 0; } - while( RFIFOREST(fd) >= 2 ) { - //For use in packets that depend on an sd being present [Skotlex] - #define FIFOSD_CHECK(rest) do { if(RFIFOREST(fd) < (rest)) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,(rest)); return 0; } } while (0) + while (RFIFOREST(fd) >= 2) { + cmd = RFIFOW(fd,0); + +//For use in packets that depend on an sd being present [Skotlex] +#define FIFOSD_CHECK(rest) do { if(RFIFOREST(fd) < (rest)) return 0; if (sd==NULL || !sd->auth) { RFIFOSKIP(fd,(rest)); return 0; } } while (0) if (VECTOR_LENGTH(HPM->packets[hpParse_Char]) > 0) { - int result = HPM->parse_packets(fd,hpParse_Char); + int result = HPM->parse_packets(fd,cmd,hpParse_Char); if (result == 1) continue; if (result == 2) return 0; } - cmd = RFIFOW(fd,0); - - switch( cmd ) { + switch (cmd) { // request to connect // 0065 <account id>.L <login id1>.L <login id2>.L <???>.W <sex>.B case 0x65: diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 03a1d368d..60efeac94 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -1201,7 +1201,7 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member g->member[0].modified = GS_MEMBER_MODIFIED; // Set default positions - g->position[0].mode = GPERM_BOTH; + g->position[0].mode = GPERM_ALL; strcpy(g->position[0].name,"GuildMaster"); strcpy(g->position[MAX_GUILDPOSITION-1].name,"Newbie"); g->position[0].modified = g->position[MAX_GUILDPOSITION-1].modified = GS_POSITION_MODIFIED; |