From 21abb8399ed26bb55fc9ed954d373115b395b45c Mon Sep 17 00:00:00 2001 From: Lupus Date: Mon, 31 Mar 2008 10:54:12 +0000 Subject: fixed aciddemo map server crash git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12454 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/map/battle.c') diff --git a/src/map/battle.c b/src/map/battle.c index ae0c9d4a0..a1b52c5e5 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2518,7 +2518,10 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * md.damage = 1+rand()%9999; break; case CR_ACIDDEMONSTRATION: // updated the formula based on a Japanese formula found to be exact [Reddozen] - md.damage = 7*tstatus->vit*sstatus->int_*sstatus->int_ / (10*(tstatus->vit+sstatus->int_)); + if(tstatus->vit+sstatus->int_) //crash fix + md.damage = 7*tstatus->vit*sstatus->int_*sstatus->int_ / (10*(tstatus->vit+sstatus->int_)); + else + md.damage = 0; if (tsd) md.damage>>=1; if (md.damage < 0 || md.damage > INT_MAX>>1) //Overflow prevention, will anyone whine if I cap it to a few billion? -- cgit v1.2.3-70-g09d2