summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-31 10:54:12 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-31 10:54:12 +0000
commit21abb8399ed26bb55fc9ed954d373115b395b45c (patch)
tree0e4c5807d10f9f69527dbd2bf3c204ad59fe0801
parentd9406a947db06d0d63b538fdd0339171bc0303b3 (diff)
downloadhercules-21abb8399ed26bb55fc9ed954d373115b395b45c.tar.gz
hercules-21abb8399ed26bb55fc9ed954d373115b395b45c.tar.bz2
hercules-21abb8399ed26bb55fc9ed954d373115b395b45c.tar.xz
hercules-21abb8399ed26bb55fc9ed954d373115b395b45c.zip
fixed aciddemo map server crash
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12454 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/battle.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index b63825035..13491d90e 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,8 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2008/03/31
+ * Fixed ACIDDEMO crash, thanks to Kaato&Konard [Lupus]
2008/03/30
* yet more login server stuff
- jA data structure compatibility renaming / adjustments
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?