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

npc_isdead : return false if npc is null #457

Merged
merged 1 commit into from
May 22, 2023
Merged

npc_isdead : return false if npc is null #457

merged 1 commit into from
May 22, 2023

Conversation

thokkat
Copy link
Contributor

@thokkat thokkat commented May 22, 2023

In ZS_Attack.d there's this line that checks in G1 if plunder animation should be played:

if (!C_NpcIsBoss(self) && C_NpcIsHuman(other) && (Npc_IsInState(other, ZS_Unconscious) || Npc_IsDead(other) || Npc_IsInState(other, ZS_MagicSleep)) )

other can be null (triggered when running away) and then animation is played if true is returned but npc is still up.

G2 has only four occurrences of Npc_IsDead(other) and always connected with other script functions so nothing is executed if npc is null.

@Try Try merged commit ee05040 into Try:master May 22, 2023
@Try
Copy link
Owner

Try commented May 22, 2023

Hi, @thokkat , and thanks for PR! Merged.

@thokkat thokkat deleted the isDead branch May 28, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants