From 47367aa228abae7ac87565bdab88f1625ba10e34 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Jul 2017 23:55:25 +0300 Subject: Move adding icon code from status_change_start into separate function. --- src/map/status.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index d26c10e40..2f6fd9c40 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -9532,18 +9532,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val_flag = status->get_val_flag(type); /* [Ind/Hercules] */ - if( sd && status->dbs->DisplayType[type] ) { - int dval1 = 0, dval2 = 0, dval3 = 0; - switch( type ) { - case SC_ALL_RIDING: - dval1 = 1; - break; - default: /* all others: just copy val1 */ - dval1 = val1; - break; - } - status->display_add(sd,type,dval1,dval2,dval3); - } + status->change_start_display(sd, type, val1, val2, val3, val4); //Those that make you stop attacking/walking.... status->change_start_stop_action(bl, type); @@ -9713,6 +9702,24 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t return 1; } +void status_change_start_display(struct map_session_data *sd, enum sc_type type, int val1, int val2, int val3, int val4) +{ + Assert_retv(type >= SC_NONE && type < SC_MAX); + + if (sd && status->dbs->DisplayType[type]) { + int dval1 = 0, dval2 = 0, dval3 = 0; + switch (type) { + case SC_ALL_RIDING: + dval1 = 1; + break; + default: /* all others: just copy val1 */ + dval1 = val1; + break; + } + status->display_add(sd, type, dval1, dval2, dval3); + } +} + /** * Return val_flag based on sc type. * @@ -13661,6 +13668,7 @@ void status_defaults(void) status->calc_ematk = status_calc_ematk; status->calc_bl_main = status_calc_bl_main; status->display_add = status_display_add; + status->change_start_display = status_change_start_display; status->display_remove = status_display_remove; status->natural_heal = status_natural_heal; status->natural_heal_timer = status_natural_heal_timer; -- cgit v1.2.3-60-g2f50