summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-07-27 14:38:11 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-07-27 14:38:11 -0700
commit33af4d422e9127086bd218e63369174ca85ea754 (patch)
treed3f7a226b15a6d24882656aecbc0fb90ebd9d19a
parentd3a9cb80ae0b1a8d5b870e145c931f5b4b7db625 (diff)
downloadtmwa-33af4d422e9127086bd218e63369174ca85ea754.tar.gz
tmwa-33af4d422e9127086bd218e63369174ca85ea754.tar.bz2
tmwa-33af4d422e9127086bd218e63369174ca85ea754.tar.xz
tmwa-33af4d422e9127086bd218e63369174ca85ea754.zip
Raging skill only with melee weapon, fix integer truncation
-rw-r--r--src/map/pc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index fb98bcb..fcf97c1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1814,9 +1814,10 @@ int pc_calcstatus (struct map_session_data *sd, int first)
// so critical chance can get multiplied by ~1.5 and setting def2 to a third when skill maxed out
// def2 is the defence gained by vit, whereas "def", which is gained by armor, stays as is
int spbsk = skill_power (sd, TMW_RAGING);
- if (spbsk!=0) {
- sd->critical *= (128 + spbsk)/256;
- sd->def2 /= (128 + spbsk)/128;
+ if (spbsk != 0 && sd->attackrange <= 2)
+ {
+ sd->critical = (sd->critical * (128 + spbsk)) / 256;
+ sd->def2 = (sd->def2 * 128) / (128 + spbsk);
}
if (sd->base_atk < 1)