Emistry - Dec 19, 2014 13:53
When I check my previous git revision, date 20141201,
status.c[code=auto:11546]
#ifdef RENEWAL
if( sd && sd->right_weapon.overrefine > 0 ) {
(*matk_min)++;
*matk_max += sd->right_weapon.overrefine - 1;
}
#endif
[/code]
it look like this
when updated to recent GIT, date 20141213 ~ 20141219 , same to line [b]11476[/b] ...[code=auto:11562]
#ifdef RENEWAL
if ( sd && !(flag & 2) ) {
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;
}
}
#endif
[/code]
and it get the error that shown in picture above and crashed.
Integer division by zero.
This post has been edited by
Emistry
on Dec 19, 2014 14:28
hemagx - Dec 19, 2014 17:21
clean one for you ? :P
[code=auto:0]
private: int __thiscall CPC::AddRandomAttackPower(int in_weaponLevel, int in_refiningLevel) const {
static const int rangeTable[4][16] = {
0, 0, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39,
0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70
0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120
14, 28, 42, 56, 70, 84, 98, 112, 126, 140, 154, 168, 182, 196, 210, 224 };
if ( in_weaponLevel > 4 ) return 0;
if ( in_refiningLevel > 16 ) return 0;
int bonus = rangeTable[in_weaponLevel][in_refiningLevel];
if ( bonus == 0 ) return 0;
return GetServerRandom(0, 20000) % bonus + 1;
};
[/code]