summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2014-12-20 00:08:03 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2014-12-20 00:08:03 +0800
commit772cb2b111973c0c749e505ffd2685bb67e887bd (patch)
tree8bdcfa0fd54ea82dc5b505d90a53d128f5807dc4
parentc7df86cc2442c29649ae44b629b05818a1742c08 (diff)
downloadhercules-772cb2b111973c0c749e505ffd2685bb67e887bd.tar.gz
hercules-772cb2b111973c0c749e505ffd2685bb67e887bd.tar.bz2
hercules-772cb2b111973c0c749e505ffd2685bb67e887bd.tar.xz
hercules-772cb2b111973c0c749e505ffd2685bb67e887bd.zip
Fixed Bug#8469
-http://hercules.ws/board/tracker/issue-8469-issue417-refine-weapon-may-caused-server-to-crash/?gopid=24287#entry24287 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
-rw-r--r--src/map/status.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 54b4a4358..53672fccf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -11469,8 +11469,9 @@ int status_get_weapon_atk(struct block_list *bl, struct weapon_atk *watk, int fl
short index = sd->equip_index[EQI_HAND_R], refine;
if ( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON
&& (refine = sd->status.inventory[index].refine) < 16 && refine ) {
- int r = (rnd() % 100) % ((status->refine_info[watk->wlv].randombonus_max[refine + (4 - watk->wlv)] / 100)) + 1;
- max += r / 10;
+ int r = status->refine_info[watk->wlv].randombonus_max[refine + (4 - watk->wlv)] / 100;
+ if ( r )
+ max += (rnd() % 100) % (r / 10) + 1;
}
}
@@ -11560,8 +11561,9 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
short index = sd->equip_index[EQI_HAND_R], refine;
if ( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON
&& (refine = sd->status.inventory[index].refine) < 16 && refine ) {
- int r = (rnd() % 100) % ((status->refine_info[sd->inventory_data[index]->wlv].randombonus_max[refine + (4 - sd->inventory_data[index]->wlv)] / 100)) + 1;
- st->matk_max += r / 10;
+ int r = status->refine_info[sd->inventory_data[index]->wlv].randombonus_max[refine + (4 - sd->inventory_data[index]->wlv)] / 100;
+ if ( r )
+ st->matk_max += (rnd() % 100) % (r / 10) + 1;
}
}
#endif