-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add creature isDead function #4231
Conversation
@@ -850,7 +850,7 @@ bool InstantSpell::playerCastInstant(Player* player, std::string& param) | |||
} | |||
|
|||
target = playerTarget; | |||
if (!target || target->getHealth() <= 0) { | |||
if (!target || target->isDead()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!target || target->isDead()) { | |
if (!target || target->isRemoved() || target->isDead()) { |
Missing removed check?
@@ -884,7 +884,7 @@ bool InstantSpell::playerCastInstant(Player* player, std::string& param) | |||
} | |||
} else { | |||
target = player->getAttackedCreature(); | |||
if (!target || target->getHealth() <= 0) { | |||
if (!target || target->isDead()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Maybe has hasHealth() could be reaplced with !isDead()? I believe in the contexts that hasHealth() is called we are checking to see if the creature is alive (!isdead). |
isAlive and isDead? |
isDead makes more sense |
Pull Request Prelude
Changes Proposed