summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-12-27 06:35:34 +0100
committerHaru <haru@dotalux.com>2015-01-23 04:14:28 +0100
commite778f4f5f1b6a08adee5e7e908a44c38cd29bd12 (patch)
tree63cbc8e6eb78ffc374ffac374bf5e533b58bcafa /src/map/status.c
parentb1b1b1aa8edc866a83029081e93d3e7d0f138189 (diff)
downloadhercules-e778f4f5f1b6a08adee5e7e908a44c38cd29bd12.tar.gz
hercules-e778f4f5f1b6a08adee5e7e908a44c38cd29bd12.tar.bz2
hercules-e778f4f5f1b6a08adee5e7e908a44c38cd29bd12.tar.xz
hercules-e778f4f5f1b6a08adee5e7e908a44c38cd29bd12.zip
Cleaned up spirit charms implementation (optimized memory and CPU usage)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 9ad8d849f..3da0238c5 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -8648,11 +8648,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC__ENERVATION:
val2 = 20 + 10 * val1; // ATK Reduction
- if ( sd ) {
- int i;
+ if (sd) {
pc->delspiritball(sd, sd->spiritball, 0);
- for (i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++)
- pc->del_charm(sd, sd->spiritcharm[i], i);
+ pc->del_charm(sd, sd->charm_count, sd->charm_type);
}
break;
case SC__GROOMY:
@@ -11495,8 +11493,8 @@ int status_get_weapon_atk(struct block_list *bl, struct weapon_atk *watk, int fl
max += (rnd() % 100) % r + 1;
}
- if ( sd->spiritcharm[SPIRITS_TYPE_CHARM_LAND] > 0 )
- max += 10 * max * sd->spiritcharm[SPIRITS_TYPE_CHARM_LAND] / 100;
+ if (sd->charm_type == CHARM_TYPE_LAND && sd->charm_count > 0)
+ max += 10 * max * sd->charm_count / 100;
}
max = status->calc_watk(bl, sc, max, false);