diff options
author | Haru <haru@dotalux.com> | 2020-05-27 13:25:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 13:25:14 +0200 |
commit | f828dfdbcafc8387afbcce11f2b951beb859d281 (patch) | |
tree | 55ebc041fd3e814c34061730d6a6759115d66c59 | |
parent | cc4956cb356e61eeab85431a07746a70c6348f19 (diff) | |
parent | 37f693585407e9282f24cb7f1166ce0898441934 (diff) | |
download | hercules-f828dfdbcafc8387afbcce11f2b951beb859d281.tar.gz hercules-f828dfdbcafc8387afbcce11f2b951beb859d281.tar.bz2 hercules-f828dfdbcafc8387afbcce11f2b951beb859d281.tar.xz hercules-f828dfdbcafc8387afbcce11f2b951beb859d281.zip |
Merge pull request #2736 from Kenpachi2k13/ancient_bug_3504
Remove misleading debug code for nonexistent skill unit group when ending SC_DANCING
-rw-r--r-- | src/map/battle.c | 12 | ||||
-rw-r--r-- | src/map/guild.c | 4 | ||||
-rw-r--r-- | src/map/pc.h | 4 | ||||
-rw-r--r-- | src/map/skill.c | 21 | ||||
-rw-r--r-- | src/map/skill.h | 2 | ||||
-rw-r--r-- | src/map/status.c | 37 | ||||
-rw-r--r-- | src/map/status.h | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 24 |
9 files changed, 42 insertions, 74 deletions
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/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; 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;i<count;i++) - skill->del_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 dc49f7e4e..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); } @@ -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; @@ -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 = "<unknown>"; - 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 = "<none>"; - } - 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,19 +10976,10 @@ 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 ) - skill->del_unitgroup(group,ALC_MARK); + skill->del_unitgroup(group); } if ((sce->val1&0xFFFF) == CG_MOONLIT) @@ -11106,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: @@ -11125,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: @@ -11223,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: @@ -11231,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/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 93f4ba960..363727d46 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -7356,8 +7356,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); @@ -7916,8 +7916,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 d5ab95ba2..c1ee157af 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -78474,15 +78474,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; @@ -78490,13 +78490,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___; @@ -86055,15 +86055,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; @@ -86071,13 +86071,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___; |