Skip to content

Commit

Permalink
Missing creature internal removed check (#4235)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo committed Oct 31, 2022
1 parent 7243e90 commit dd57ecb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ bool InstantSpell::playerCastInstant(Player* player, std::string& param)
}

target = playerTarget;
if (!target || target->isDead()) {
if (!target || target->isRemoved() || target->isDead()) {
if (!casterTargetOrDirection) {
if (cooldown > 0) {
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_SPELLCOOLDOWN,
Expand Down Expand Up @@ -883,7 +883,7 @@ bool InstantSpell::playerCastInstant(Player* player, std::string& param)
}
} else {
target = player->getAttackedCreature();
if (!target || target->isDead()) {
if (!target || target->isRemoved() || target->isDead()) {
if (!casterTargetOrDirection) {
player->sendCancelMessage(RETURNVALUE_YOUCANONLYUSEITONCREATURES);
g_game.addMagicEffect(player->getPosition(), CONST_ME_POFF);
Expand Down

0 comments on commit dd57ecb

Please sign in to comment.