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

StaticFlags: Implement CANNOT_DAZE #540

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

insunaa
Copy link
Contributor

@insunaa insunaa commented Aug 9, 2024

🍰 Pullrequest

This PR implements CreatureStaticFlags4::CANNOT_DAZE

@@ -3271,7 +3271,7 @@ bool Unit::CanGlance() const
bool Unit::CanDaze() const
{
// Generally, only npcs are able to daze targets in melee
return (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED));
return (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && !static_cast<const Creature*>(this)->GetSettings().HasFlag(CreatureStaticFlags4::CANNOT_DAZE));
Copy link
Contributor

Choose a reason for hiding this comment

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

Make the function virtual, return false by default, override it in creature and there do isplayercontrolled and the other check (at this point we know how daze works so encapsulation wont hinder anything and will be nicer)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@killerwife killerwife merged commit a34ccb4 into cmangos:master Oct 7, 2024
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