summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-28 09:15:27 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-28 09:15:27 +0200
commit4e1ad8189f05a36b297d42e2d5ac24a76ae30f5f (patch)
tree3a5419fdab741597d8626376ce1b9f0344097f3c /src
parent9a06857cc3ad2ad8f00b52ccc33f6c07342ad985 (diff)
downloadhercules-4e1ad8189f05a36b297d42e2d5ac24a76ae30f5f.tar.gz
hercules-4e1ad8189f05a36b297d42e2d5ac24a76ae30f5f.tar.bz2
hercules-4e1ad8189f05a36b297d42e2d5ac24a76ae30f5f.tar.xz
hercules-4e1ad8189f05a36b297d42e2d5ac24a76ae30f5f.zip
Call clif_status_change() instead of clif_status_change2() to re-apply status changes in clif_spawn()
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 649df3e33..43ac848d0 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)