Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Abracadabra and Improvised Skill #2859

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/map/unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ static int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_
int ret = unit->skilluse_id2(src, target_id, skill_id, skill_lv, casttime, castcancel);
struct map_session_data *sd = BL_CAST(BL_PC, src);

if (sd != NULL)
if (sd != NULL && ret == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this mean after this change auto cast never cleaned if skill was used without errors?
i think this wrong

Copy link
Member

@Kenpachi2k13 Kenpachi2k13 Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit->skilluse_id2() returns 0 on failure, so this is okay. (Nevermind... I misread your comment.)

Maybe the

else if (sd != NULL && ret != 0 && skill_id != SA_ABRACADABRA && skill_id != WM_RANDOMIZESPELL)
		skill->validate_autocast_data(sd, skill_id, skill_lv);

block I removed in #2699 (LINK) should be re-added, too.
I currently can't have a closer look at this, so this is just a suggestion...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@4144 the problem is, this function is triggered before actual casting of skill, so removing this check caused autocast struct to be emptied, and skill failed to cast.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dastgirp This definitely needs to be adressed what 4144 mentioned.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a look at this and the condition should be changed to:

if (sd != NULL && (ret == 0 || (skill_id != SA_ABRACADABRA && skill_id != WM_RANDOMIZESPELL)))

pc->autocast_remove(sd, sd->auto_cast_current.type, sd->auto_cast_current.skill_id,
sd->auto_cast_current.skill_lv);

Expand Down Expand Up @@ -1793,7 +1793,7 @@ static int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_
int ret = unit->skilluse_pos2(src, skill_x, skill_y, skill_id, skill_lv, casttime, castcancel);
struct map_session_data *sd = BL_CAST(BL_PC, src);

if (sd != NULL)
if (sd != NULL && ret == 0)
pc->autocast_remove(sd, sd->auto_cast_current.type, sd->auto_cast_current.skill_id,
sd->auto_cast_current.skill_lv);

Expand Down