summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}