diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/chrif.c | 12 | ||||
-rw-r--r-- | src/map/pc.c | 8 | ||||
-rw-r--r-- | src/map/status.c | 16 |
3 files changed, 26 insertions, 10 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index e95858df9..2396f5175 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1415,14 +1415,14 @@ int chrif_disconnect(int fd) { }
void chrif_update_ip(int fd){
- struct hostent *h = map_server_dns?gethostbyname(map_server_dns):NULL;
+ char ip[4];
ShowInfo("IP Sync in progress...\n");
- if(h){
+ if (map_server_dns && resolve_hostbyname(map_server_dns, ip)) {
WFIFOW(fd, 0) = 0x2736;
- WFIFOB(fd, 2) = h->h_addr[0];
- WFIFOB(fd, 3) = h->h_addr[1];
- WFIFOB(fd, 4) = h->h_addr[2];
- WFIFOB(fd, 5) = h->h_addr[3];
+ WFIFOB(fd, 2) = ip[0];
+ WFIFOB(fd, 3) = ip[1];
+ WFIFOB(fd, 4) = ip[2];
+ WFIFOB(fd, 5) = ip[3];
WFIFOSET(fd, 6);
}
}
diff --git a/src/map/pc.c b/src/map/pc.c index 8e1ed1d25..9090a7a65 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1552,14 +1552,14 @@ int pc_bonus(struct map_session_data *sd,int type,int val) case SP_NO_MAGIC_DAMAGE:
if(sd->state.lr_flag == 2)
break;
- val+= sd->special_state.no_magic_damage;
- sd->special_state.no_magic_damage = cap_value(val,0,100);
+ val+= sd->special_state.no_magic_damage;
+ sd->special_state.no_magic_damage = cap_value(val,0,100);
break;
case SP_NO_WEAPON_DAMAGE:
if(sd->state.lr_flag == 2)
break;
- val+= sd->special_state.no_weapon_damage;
- sd->special_state.no_weapon_damage = cap_value(val,0,100);
+ val+= sd->special_state.no_weapon_damage;
+ sd->special_state.no_weapon_damage = cap_value(val,0,100);
break;
case SP_NO_GEMSTONE:
if(sd->state.lr_flag != 2)
diff --git a/src/map/status.c b/src/map/status.c index 8fe79f999..98a6ad652 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -767,6 +767,22 @@ int status_percent_change(struct block_list *src,struct block_list *target,signe if (sp_rate && !sp) sp = 1; + //Ugly check in case damage dealt is too much for the received args of + //status_heal / status_damage. [Skotlex] + if (hp > INT_MAX) { + hp -= INT_MAX; + if (flag) + status_heal(target, INT_MAX, 0, 0); + else + status_damage(src, target, INT_MAX, 0, 0, (!src||src==target?5:1)); + } + if (sp > INT_MAX) { + sp -= INT_MAX; + if (flag) + status_heal(target, 0, INT_MAX, 0); + else + status_damage(src, target, 0, INT_MAX, 0, (!src||src==target?5:1)); + } if (flag) return status_heal(target, hp, sp, 0); return status_damage(src, target, hp, sp, 0, (!src||src==target?5:1)); } |