Skip to content

Commit

Permalink
Missing creature internal removed check (otland#4235)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo authored and EPuncker committed May 23, 2023
1 parent 9641abe commit 3e8a55a
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 @@ -875,7 +875,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, cooldown, 0, false, spellId);
Expand Down Expand Up @@ -905,7 +905,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 3e8a55a

Please sign in to comment.