Skip to content

Commit

Permalink
fix: use flask on familiar (#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
duuh30 committed Apr 26, 2024
1 parent 56793a0 commit e133c33
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/game/game.cpp
Expand Up @@ -3744,6 +3744,19 @@ void Game::playerUseWithCreature(uint32_t playerId, const Position &fromPos, uin
return;
}
}

const std::shared_ptr<Monster> monster = creature->getMonster();
if (monster && monster->isFamiliar() && creature->getMaster()->getPlayer() == player && (it.isRune() || it.type == ITEM_TYPE_POTION)) {
player->setNextPotionAction(OTSYS_TIME() + g_configManager().getNumber(EX_ACTIONS_DELAY_INTERVAL, __FUNCTION__));

if (it.isMultiUse()) {
player->sendUseItemCooldown(g_configManager().getNumber(EX_ACTIONS_DELAY_INTERVAL, __FUNCTION__));
}

player->sendCancelMessage(RETURNVALUE_CANNOTUSETHISOBJECT);
return;
}

Position toPos = creature->getPosition();
Position walkToPos = fromPos;
ReturnValue ret = g_actions().canUse(player, fromPos);
Expand Down

0 comments on commit e133c33

Please sign in to comment.