diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-05 20:53:15 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-05 20:53:15 +0000 |
commit | 64f4cc701fb78e585514eaa894dfd98cbbf224bf (patch) | |
tree | 01c694992c4eb8968c0f6ffcd126a9c7f6633895 /src/char_sql | |
parent | 01368ed9a40bc98ac870b04380ad1344485962e4 (diff) | |
download | hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.tar.gz hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.tar.bz2 hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.tar.xz hercules-64f4cc701fb78e585514eaa894dfd98cbbf224bf.zip |
Fixing several compilation & runtime problems
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10164 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index e68ea61dc..b0de20e75 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -3152,7 +3152,6 @@ int parse_char(int fd) int map_fd; struct char_session_data *sd; uint32 ipl = session[fd]->client_addr; - uint32 subnet_map_ip; RFIFOHEAD(fd); sd = (struct char_session_data*)session[fd]->session_data; @@ -3340,6 +3339,7 @@ int parse_char(int fd) } { //Send player to map. + uint32 subnet_map_ip; char map_name[MAP_NAME_LENGTH]; snprintf(map_name, MAP_NAME_LENGTH, "%s.gat", mapindex_id2name(char_dat.last_point.map)); @@ -3349,11 +3349,8 @@ int parse_char(int fd) memcpy(WFIFOP(fd,6), map_name, MAP_NAME_LENGTH); // Advanced subnet check [LuzZza] - if(subnet_map_ip = lan_subnetcheck(ipl)) - WFIFOL(fd,22) = htonl(subnet_map_ip); - else - WFIFOL(fd,22) = htonl(server[i].ip); - + subnet_map_ip = lan_subnetcheck(ipl); + WFIFOL(fd,22) = (subnet_map_ip) ? htonl(subnet_map_ip) : htonl(server[i].ip); WFIFOW(fd,26) = server[i].port; // /!\ must be sent in intel host byte order /!\ (client bug) WFIFOSET(fd,28); } @@ -4221,11 +4218,11 @@ int do_init(int argc, char **argv) ShowStatus("Defaulting to %s as our IP address\n", ip_str); if (!login_ip) { strcpy(login_ip_str, ip_str); - login_ip = inet_addr(login_ip_str); + login_ip = ntohl(inet_addr(login_ip_str)); } if (!char_ip) { strcpy(char_ip_str, ip_str); - char_ip = inet_addr(char_ip_str); + char_ip = ntohl(inet_addr(char_ip_str)); } } |