summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-28 01:27:59 +0100
committerHaru <haru@dotalux.com>2015-01-28 01:27:59 +0100
commit3a5b0c03e46158e1edd6ec88dfcace45e22c7a91 (patch)
tree70a9a6131588735298c776191b271d23f2bc9869 /src/map/pc.c
parent16157a6173bf116026d6d3be11c7f9e1a35e8b9a (diff)
downloadhercules-3a5b0c03e46158e1edd6ec88dfcace45e22c7a91.tar.gz
hercules-3a5b0c03e46158e1edd6ec88dfcace45e22c7a91.tar.bz2
hercules-3a5b0c03e46158e1edd6ec88dfcace45e22c7a91.tar.xz
hercules-3a5b0c03e46158e1edd6ec88dfcace45e22c7a91.zip
Follow-up to e778f4f5f1b6a08adee5e7e908a44c38cd29bd12
- Fixed some issues that prevented spirit charms from showing up - Special thanks to Michieru Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 2013bb652..f41665fad 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9811,6 +9811,7 @@ int pc_charm_timer(int tid, int64 tick, int id, intptr_t data)
if (sd->charm_count <= 0) {
ShowError("pc_charm_timer: %d spiritcharm's available. (aid=%d cid=%d tid=%d)\n", sd->charm_count, sd->status.account_id, sd->status.char_id, tid);
sd->charm_count = 0;
+ sd->charm_type = CHARM_TYPE_NONE;
return 0;
}
@@ -9824,6 +9825,8 @@ int pc_charm_timer(int tid, int64 tick, int id, intptr_t data)
if(i != sd->charm_count)
memmove(sd->charm_timer+i, sd->charm_timer+i+1, (sd->charm_count-i)*sizeof(int));
sd->charm_timer[sd->charm_count] = INVALID_TIMER;
+ if (sd->charm_count <= 0)
+ sd->charm_type = CHARM_TYPE_NONE;
clif->spiritcharm(sd);
@@ -9868,6 +9871,7 @@ void pc_add_charm(struct map_session_data *sd, int interval, int max, int type)
memmove(sd->charm_timer+i+1, sd->charm_timer+i, (sd->charm_count-i)*sizeof(int));
sd->charm_timer[i] = tid;
sd->charm_count++;
+ sd->charm_type = type;
clif->spiritcharm(sd);
}
@@ -9911,6 +9915,8 @@ void pc_del_charm(struct map_session_data *sd, int count, int type)
sd->charm_timer[i-count] = sd->charm_timer[i];
sd->charm_timer[i] = INVALID_TIMER;
}
+ if (sd->charm_count <= 0)
+ sd->charm_type = CHARM_TYPE_NONE;
clif->spiritcharm(sd);
}