hallux
New Member
Hi, Im a long term fan of the community but havent really done/contributed much so i thought i'd start with this. I am just poking around trying to setup something to play myself and possibly host later down the line. One thing that is bothering may playing on latest TFS with OtClientV8 is that when i am using a potion and try to loot a monster (i.e. mid combat) then the monster doesnt open. After tracking this down, i realised that opening a corpse is considered an action and when the potion is used its getting the timeBetweenActionEx delay added (i.e. 1000ms). I have put in a small hack to work around this that lets you open any container regardless of action cooldown. Im wondering if anyone else is annoyed by this and if its worth a pull request as im definately sure you can loot and use potion in real tibia? Alternatively could this be something happening with OtClientV8 as i noticed when i use a potion im getting callback from "playerUseWithCreature" which seems like a strange callback although i dont know the protocol well.
Here is the code i added in case anyone is curious. Its in game.cpp playerUseItem (line 2175)
Here is the code i added in case anyone is curious. Its in game.cpp playerUseItem (line 2175)
C++:
if (!item->getContainer() && !player->canDoAction()) {
uint32_t delay = player->getNextActionTime();
SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerUseItem, this,
playerId, pos, stackPos, index, spriteId));
player->setNextActionTask(task);
return;
}