Add caster block_list to all skill_get_* accessors - #3436
Open
MrKeiKun wants to merge 2 commits into
Open
Conversation
Adds struct block_list *bl as the first parameter to skill->get_hit, get_ele, get_num, get_range, get_splash, get_sp, get_zeny, get_cast, get_delay, get_cooldown, get_castdef, get_type, get_maxcount and get_blewcount, following the existing get_range2 precedent, so plugins can vary a skill's stats based on who is casting it (fixes HerculesWS#2793).
Adds struct block_list *bl as the first parameter to the remaining skill_get_* getters (metadata, cost, requirement, unit-placement and cast-timing accessors), matching the earlier damage/behavior getter conversion. Excludes get_index, get_index_sub, get_casttype2, get_any_item_index and get_new_group_id, which are keyed by an internal index or have no skill_id-based shape, and get_requirement, which already receives the caster via its sd parameter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Prelude
Changes Proposed
struct block_list *blas the first parameter to everyskill_get_*accessor keyed byskill_id, following the existing precedent set byskill->get_range2.skill.c,battle.c,clif.c,status.c,unit.c,pc.c,mob.c, and others) to pass the caster through.HPMHooking_map.Hooks.inchook blocks so HPM plugins can hook these functions with the new signature.blis not read by any of the default implementations. This is purely enabling infrastructure so a plugin hook can branch on the caster (e.g.bl->type, or a specific unit) when overriding askill_get_*function, which previously had no way to know who was casting.Converted:
Issues addressed: #2793