summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/skill.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 269b72ae1..be56f06cd 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3999,7 +3999,7 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
if(dstsd->spiritball > 0)
clif->spiritball_single(sd->fd, dstsd);
- if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count > 0)
+ if (dstsd->charm_type != CHARM_TYPE_NONE && dstsd->charm_count > 0)
clif->charm_single(sd->fd, dstsd);
for( i = 0; i < dstsd->sc_display_count; i++ ) {
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);
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 55b86310e..c6ddd883d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -13730,7 +13730,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
break;
case KO_KAIHOU:
case KO_ZENKAI:
- if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count > 0) {
+ if (sd->charm_type == CHARM_TYPE_NONE || sd->charm_count <= 0) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0);
return 0;
}