diff options
author | Haru <haru@dotalux.com> | 2020-06-28 23:48:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-28 23:48:07 +0200 |
commit | 299655f9cf58aa752903cae55f95acc6f5de7992 (patch) | |
tree | 139ec1993db652d66ba57df1efc73c37134f0af2 /src/map | |
parent | 70a1e86082e107bcf27c972395047251ec6520fb (diff) | |
parent | 4e1ad8189f05a36b297d42e2d5ac24a76ae30f5f (diff) | |
download | hercules-299655f9cf58aa752903cae55f95acc6f5de7992.tar.gz hercules-299655f9cf58aa752903cae55f95acc6f5de7992.tar.bz2 hercules-299655f9cf58aa752903cae55f95acc6f5de7992.tar.xz hercules-299655f9cf58aa752903cae55f95acc6f5de7992.zip |
Merge pull request #2786 from Kenpachi2k13/sc_timer
Pass timer data when re-applying status icons upon spawning character
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 8e94686c4..fd84961d9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1596,10 +1596,33 @@ static bool clif_spawn(struct block_list *bl) clif->specialeffect(bl,421,AREA); if (sd->bg_id != 0 && map->list[sd->bl.m].flag.battleground) clif->sendbgemblem_area(sd); - for (i = 0; i < sd->sc_display_count; i++) { - clif->sc_continue(&sd->bl, sd->bl.id, AREA, status->get_sc_icon(sd->sc_display[i]->type), sd->sc_display[i]->val1, sd->sc_display[i]->val2, sd->sc_display[i]->val3); + struct status_change *sc = status->get_sc(bl); + + if (sd->sc_display_count > 0 && sc != NULL) { + for (i = 0; i < sd->sc_display_count; i++) { + enum sc_type type = sd->sc_display[i]->type; + + if (sc->data[type] == NULL) + continue; + + int tick = 0; + int tid = sc->data[type]->timer; + const struct TimerData *td = (tid > 0) ? timer->get(tid) : NULL; + + if (td != NULL) + tick = DIFF_TICK32(td->tick, timer->gettick()); + + int sc_icon = status->get_sc_icon(type); + int sc_types = status->get_sc_relevant_bl_types(type); + int val1 = sd->sc_display[i]->val1; + int val2 = sd->sc_display[i]->val2; + int val3 = sd->sc_display[i]->val3; + + clif->status_change(&sd->bl, sc_icon, sc_types, 1, tick, val1, val2, val3); + } } + if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count > 0) clif->spiritcharm(sd); if (sd->status.look.robe != 0) |