From 5fa882fc81a26825afedefa050fe642e9c50a7b6 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Sat, 23 May 2020 14:56:10 +0200 Subject: remove debug message and related code for missing unit group in case SC_DANCING in status_change_end_() --- src/map/status.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/map') diff --git a/src/map/status.c b/src/map/status.c index dc49f7e4e..1f887a250 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -10958,23 +10958,9 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid, break; case SC_DANCING: { - const char* prevfile = ""; - int prevline = 0; struct map_session_data *dsd; struct status_change_entry *dsc; - if (sd) { - if (sd->delunit_prevfile) { - // initially this is NULL, when a character logs in - prevfile = sd->delunit_prevfile; - prevline = sd->delunit_prevline; - } else { - prevfile = ""; - } - sd->delunit_prevfile = file; - sd->delunit_prevline = line; - } - if (sce->val4 && sce->val4 != BCT_SELF && (dsd=map->id2sd(sce->val4)) != NULL) { // end status on partner as well dsc = dsd->sc.data[SC_DANCING]; @@ -10990,15 +10976,6 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid, // erase associated land skill struct skill_unit_group *group = skill->id2group(sce->val2); - if (group == NULL) { - ShowDebug("status_change_end: SC_DANCING is missing skill unit group (val1=%d, val2=%d, val3=%d, val4=%d, timer=%d, tid=%d, char_id=%d, map=%s, x=%d, y=%d, prev=%s:%d, from=%s:%d). Please report this! (#3504)\n", - sce->val1, sce->val2, sce->val3, sce->val4, sce->timer, tid, - sd ? sd->status.char_id : 0, - mapindex_id2name(map_id2index(bl->m)), bl->x, bl->y, - prevfile, prevline, - file, line); - } - sce->val2 = 0; if( group ) -- cgit v1.2.3-60-g2f50 From d90860857d0e6a30edad6c0df97e87b5eb110db9 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Sat, 23 May 2020 15:03:53 +0200 Subject: Remove superfluous parameters file and line from status_change_end_() --- src/map/status.c | 2 +- src/map/status.h | 4 ++-- src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 ++-- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/map') diff --git a/src/map/status.c b/src/map/status.c index 1f887a250..13cf8b553 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -10788,7 +10788,7 @@ static int status_change_clear(struct block_list *bl, int type) /*========================================== * Special condition we want to effectuate, check before ending a status. *------------------------------------------*/ -static int status_change_end_(struct block_list *bl, enum sc_type type, int tid, const char *file, int line) +static int status_change_end_(struct block_list *bl, enum sc_type type, int tid) { struct map_session_data *sd; struct status_change *sc; diff --git a/src/map/status.h b/src/map/status.h index d5cb3da75..43cfd6931 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1214,7 +1214,7 @@ struct status_change { #define sc_start2(src, bl, type, rate, val1, val2, tick) (status->change_start((src),(bl),(type),100*(rate),(val1),(val2),0,0,(tick),SCFLAG_NONE)) #define sc_start4(src, bl, type, rate, val1, val2, val3, val4, tick) (status->change_start((src),(bl),(type),100*(rate),(val1),(val2),(val3),(val4),(tick),SCFLAG_NONE)) -#define status_change_end(bl,type,tid) (status->change_end_((bl),(type),(tid),__FILE__,__LINE__)) +#define status_change_end(bl,type,tid) (status->change_end_((bl),(type),(tid))) #define status_calc_bl(bl, flag) (status->calc_bl_((bl), (enum scb_flag)(flag), SCO_NONE)) #define status_calc_mob(md, opt) (status->calc_bl_(&(md)->bl, SCB_ALL, (opt))) @@ -1308,7 +1308,7 @@ struct status_interface { int (*get_sc_def) (struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag); int (*change_start) (struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag); int (*change_start_sub) (struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int total_tick, int flag); - int (*change_end_) (struct block_list* bl, enum sc_type type, int tid, const char* file, int line); + int (*change_end_) (struct block_list* bl, enum sc_type type, int tid); bool (*is_immune_to_status) (struct status_change* sc, enum sc_type type); bool (*is_boss_resist_sc) (enum sc_type type); bool (*end_sc_before_start) (struct block_list *bl, struct status_data *st, struct status_change* sc, enum sc_type type, int undead_flag, int val1, int val2, int val3, int val4); diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index ef71f1967..e043ef768 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -7898,8 +7898,8 @@ typedef int (*HPMHOOK_pre_status_change_start) (struct block_list **src, struct typedef int (*HPMHOOK_post_status_change_start) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag); typedef int (*HPMHOOK_pre_status_change_start_sub) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *total_tick, int *flag); typedef int (*HPMHOOK_post_status_change_start_sub) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int total_tick, int flag); -typedef int (*HPMHOOK_pre_status_change_end_) (struct block_list **bl, enum sc_type *type, int *tid, const char **file, int *line); -typedef int (*HPMHOOK_post_status_change_end_) (int retVal___, struct block_list *bl, enum sc_type type, int tid, const char *file, int line); +typedef int (*HPMHOOK_pre_status_change_end_) (struct block_list **bl, enum sc_type *type, int *tid); +typedef int (*HPMHOOK_post_status_change_end_) (int retVal___, struct block_list *bl, enum sc_type type, int tid); typedef bool (*HPMHOOK_pre_status_is_immune_to_status) (struct status_change **sc, enum sc_type *type); typedef bool (*HPMHOOK_post_status_is_immune_to_status) (bool retVal___, struct status_change *sc, enum sc_type type); typedef bool (*HPMHOOK_pre_status_is_boss_resist_sc) (enum sc_type *type); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 02d55228e..97c1a31c0 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -85816,15 +85816,15 @@ int HP_status_change_start_sub(struct block_list *src, struct block_list *bl, en } return retVal___; } -int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid, const char *file, int line) { +int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_status_change_end__pre > 0) { - int (*preHookFunc) (struct block_list **bl, enum sc_type *type, int *tid, const char **file, int *line); + int (*preHookFunc) (struct block_list **bl, enum sc_type *type, int *tid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_end__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_change_end__pre[hIndex].func; - retVal___ = preHookFunc(&bl, &type, &tid, &file, &line); + retVal___ = preHookFunc(&bl, &type, &tid); } if (*HPMforce_return) { *HPMforce_return = false; @@ -85832,13 +85832,13 @@ int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid, con } } { - retVal___ = HPMHooks.source.status.change_end_(bl, type, tid, file, line); + retVal___ = HPMHooks.source.status.change_end_(bl, type, tid); } if (HPMHooks.count.HP_status_change_end__post > 0) { - int (*postHookFunc) (int retVal___, struct block_list *bl, enum sc_type type, int tid, const char *file, int line); + int (*postHookFunc) (int retVal___, struct block_list *bl, enum sc_type type, int tid); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_end__post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_change_end__post[hIndex].func; - retVal___ = postHookFunc(retVal___, bl, type, tid, file, line); + retVal___ = postHookFunc(retVal___, bl, type, tid); } } return retVal___; -- cgit v1.2.3-60-g2f50 From 52fca53139167fe93e7251de269d764b001daa66 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Sat, 23 May 2020 15:13:23 +0200 Subject: Remove superfluous parameters file, line and func from skill_delunitgroup() --- src/map/battle.c | 12 ++++++------ src/map/guild.c | 4 ++-- src/map/skill.c | 21 ++++++++------------- src/map/skill.h | 2 +- src/map/status.c | 12 ++++++------ src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 ++-- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 12 ++++++------ 7 files changed, 31 insertions(+), 36 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index c8cd71b94..a8193d24a 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2832,18 +2832,18 @@ static int64 battle_calc_damage(struct block_list *src, struct block_list *bl, s d->dmg_lv = ATK_BLOCK; if(src_skill_id == MH_STEINWAND){ if (--group->val2<=0) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); if( (group->val3 - damage) > 0 ) group->val3 -= (int)cap_value(damage, INT_MIN, INT_MAX); else - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); return 0; } if( skill_id == SO_ELEMENTAL_SHIELD ) { if ( ( group->val2 - damage) > 0 ) { group->val2 -= (int)cap_value(damage,INT_MIN,INT_MAX); } else - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); return 0; } /** @@ -2853,12 +2853,12 @@ static int64 battle_calc_damage(struct block_list *src, struct block_list *bl, s if ( ( group->val2 - damage) > 0 ) { group->val2 -= (int)cap_value(damage,INT_MIN,INT_MAX); } else - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); if (--group->val3<=0) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); #else if (--group->val2<=0) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); #endif return 0; } diff --git a/src/map/guild.c b/src/map/guild.c index f344878e1..90f870f1c 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1519,7 +1519,7 @@ static void guild_guildaura_refresh(struct map_session_data *sd, uint16 skill_id if( !skill_lv ) return; if (sd->sc.data[type] && (group = skill->id2group(sd->sc.data[type]->val4)) != NULL) { - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); status_change_end(&sd->bl,type,INVALID_TIMER); } group = skill->unitsetting(&sd->bl,skill_id,skill_lv,sd->bl.x,sd->bl.y,0); @@ -2069,7 +2069,7 @@ static int guild_break(struct map_session_data *sd, const char *name) } } for(i = 0; i < count; i++) { // FIXME: Why is this not done in the above loop? - skill->del_unitgroup(groups[i],ALC_MARK); + skill->del_unitgroup(groups[i]); } } diff --git a/src/map/skill.c b/src/map/skill.c index caa1a0f29..e3fa6b0a1 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -12535,7 +12535,7 @@ static struct skill_unit_group *skill_unitsetting(struct block_list *src, uint16 if (!group->alive_count) { //No cells? Something that was blocked completely by Land Protector? - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); return NULL; } @@ -12651,7 +12651,7 @@ static int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int unsigned short m = sg->val3; if( --count <= 0 ) - skill->del_unitgroup(sg,ALC_MARK); + skill->del_unitgroup(sg); if ( map->mapindex2mapid(sg->val3) == sd->bl.m && x == sd->bl.x && y == sd->bl.y ) working = 1;/* we break it because officials break it, lovely stuff. */ @@ -12957,7 +12957,7 @@ static int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *b sg->val1--; } if (sg->val1 <= 0) - skill->del_unitgroup(sg, ALC_MARK); + skill->del_unitgroup(sg); break; case UNT_EVILLAND: @@ -16644,7 +16644,7 @@ static int skill_clear_group(struct block_list *bl, int flag) } for (i=0;idel_unitgroup(group[i],ALC_MARK); + skill->del_unitgroup(group[i]); return count; } @@ -17292,7 +17292,7 @@ static int skill_delunit(struct skill_unit *su) map->deliddb(&su->bl); idb_remove(skill->unit_db, su->bl.id); if(--group->alive_count==0) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); return 0; } @@ -17351,7 +17351,7 @@ static struct skill_unit_group *skill_initunitgroup(struct block_list *src, int j = i; } } - skill->del_unitgroup(ud->skillunit[j],ALC_MARK); + skill->del_unitgroup(ud->skillunit[j]); //Since elements must have shifted, we use the last slot. i = MAX_SKILLUNITGROUP-1; } @@ -17390,18 +17390,13 @@ static struct skill_unit_group *skill_initunitgroup(struct block_list *src, int /*========================================== * *------------------------------------------*/ -static int skill_delunitgroup(struct skill_unit_group *group, const char *file, int line, const char *func) +static int skill_delunitgroup(struct skill_unit_group *group) { struct block_list* src; struct unit_data *ud; int i,j; struct map_session_data *sd = NULL; - if( group == NULL ) { - ShowDebug("skill_delunitgroup: group is NULL (source=%s:%d, %s)! Please report this! (#3504)\n", file, line, func); - return 0; - } - src = map->id2bl(group->src_id); ud = unit->bl2ud(src); sd = BL_CAST(BL_PC, src); @@ -17533,7 +17528,7 @@ static int skill_clear_unitgroup(struct block_list *src) nullpo_ret(ud); while (ud->skillunit[0]) - skill->del_unitgroup(ud->skillunit[0],ALC_MARK); + skill->del_unitgroup(ud->skillunit[0]); return 1; } diff --git a/src/map/skill.h b/src/map/skill.h index 4dbbaf147..651a355cf 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -2020,7 +2020,7 @@ struct skill_interface { struct skill_unit *(*initunit) (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2); int (*delunit) (struct skill_unit *su); struct skill_unit_group *(*init_unitgroup) (struct block_list* src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval); - int (*del_unitgroup) (struct skill_unit_group *group, const char* file, int line, const char* func); + int (*del_unitgroup) (struct skill_unit_group *group); int (*clear_unitgroup) (struct block_list *src); int (*clear_group) (struct block_list *bl, int flag); int (*unit_onplace) (struct skill_unit *src, struct block_list *bl, int64 tick); diff --git a/src/map/status.c b/src/map/status.c index 13cf8b553..b0cb07d11 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1201,7 +1201,7 @@ static int status_damage(struct block_list *src, struct block_list *target, int6 if ((sce=sc->data[SC_GRAVITATION]) && sce->val3 == BCT_SELF) { struct skill_unit_group* sg = skill->id2group(sce->val4); if (sg) { - skill->del_unitgroup(sg, ALC_MARK); + skill->del_unitgroup(sg); sce->val4 = 0; status_change_end(target, SC_GRAVITATION, INVALID_TIMER); } @@ -10979,7 +10979,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid) sce->val2 = 0; if( group ) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); } if ((sce->val1&0xFFFF) == CG_MOONLIT) @@ -11083,7 +11083,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid) struct skill_unit_group* group = skill->id2group(sce->val3); sce->val3 = 0; if( group ) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); } break; case SC_HERMODE: @@ -11102,7 +11102,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid) struct skill_unit_group* group = skill->id2group(sce->val4); sce->val4 = 0; if( group ) /* might have been cleared before status ended, e.g. land protector */ - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); } break; case SC_KAAHI: @@ -11200,7 +11200,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid) struct skill_unit_group* group = skill->id2group(sce->val2); sce->val2 = 0; if (group) /* might have been cleared before status ended, e.g. land protector */ - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); } break; case SC_BANDING: @@ -11208,7 +11208,7 @@ static int status_change_end_(struct block_list *bl, enum sc_type type, int tid) struct skill_unit_group *group = skill->id2group(sce->val4); sce->val4 = 0; if( group ) /* might have been cleared before status ended, e.g. land protector */ - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); } break; case SC_CURSEDCIRCLE_ATKER: diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index e043ef768..fa336f704 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -7338,8 +7338,8 @@ typedef int (*HPMHOOK_pre_skill_delunit) (struct skill_unit **su); typedef int (*HPMHOOK_post_skill_delunit) (int retVal___, struct skill_unit *su); typedef struct skill_unit_group* (*HPMHOOK_pre_skill_init_unitgroup) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval); typedef struct skill_unit_group* (*HPMHOOK_post_skill_init_unitgroup) (struct skill_unit_group* retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval); -typedef int (*HPMHOOK_pre_skill_del_unitgroup) (struct skill_unit_group **group, const char **file, int *line, const char **func); -typedef int (*HPMHOOK_post_skill_del_unitgroup) (int retVal___, struct skill_unit_group *group, const char *file, int line, const char *func); +typedef int (*HPMHOOK_pre_skill_del_unitgroup) (struct skill_unit_group **group); +typedef int (*HPMHOOK_post_skill_del_unitgroup) (int retVal___, struct skill_unit_group *group); typedef int (*HPMHOOK_pre_skill_clear_unitgroup) (struct block_list **src); typedef int (*HPMHOOK_post_skill_clear_unitgroup) (int retVal___, struct block_list *src); typedef int (*HPMHOOK_pre_skill_clear_group) (struct block_list **bl, int *flag); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 97c1a31c0..154f2bc59 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -78235,15 +78235,15 @@ struct skill_unit_group* HP_skill_init_unitgroup(struct block_list *src, int cou } return retVal___; } -int HP_skill_del_unitgroup(struct skill_unit_group *group, const char *file, int line, const char *func) { +int HP_skill_del_unitgroup(struct skill_unit_group *group) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_skill_del_unitgroup_pre > 0) { - int (*preHookFunc) (struct skill_unit_group **group, const char **file, int *line, const char **func); + int (*preHookFunc) (struct skill_unit_group **group); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_del_unitgroup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_del_unitgroup_pre[hIndex].func; - retVal___ = preHookFunc(&group, &file, &line, &func); + retVal___ = preHookFunc(&group); } if (*HPMforce_return) { *HPMforce_return = false; @@ -78251,13 +78251,13 @@ int HP_skill_del_unitgroup(struct skill_unit_group *group, const char *file, int } } { - retVal___ = HPMHooks.source.skill.del_unitgroup(group, file, line, func); + retVal___ = HPMHooks.source.skill.del_unitgroup(group); } if (HPMHooks.count.HP_skill_del_unitgroup_post > 0) { - int (*postHookFunc) (int retVal___, struct skill_unit_group *group, const char *file, int line, const char *func); + int (*postHookFunc) (int retVal___, struct skill_unit_group *group); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_del_unitgroup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_del_unitgroup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, group, file, line, func); + retVal___ = postHookFunc(retVal___, group); } } return retVal___; -- cgit v1.2.3-60-g2f50 From 37f693585407e9282f24cb7f1166ce0898441934 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Sat, 23 May 2020 15:21:06 +0200 Subject: Remove debug variables delunit_prevfile and delunit_prevline from struct map_session_data --- src/map/pc.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/map') diff --git a/src/map/pc.h b/src/map/pc.h index e560df549..8d1cd0ca4 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -629,10 +629,6 @@ END_ZEROED_BLOCK; uint8 lang_id; - // temporary debugging of bug #3504 - const char* delunit_prevfile; - int delunit_prevline; - // HatEffect VECTOR_DECL(int) hatEffectId; -- cgit v1.2.3-60-g2f50