• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Problems with using items and exhaust

Fredrikli

Member
Joined
May 26, 2010
Messages
133
Reaction score
7
I've got a minor but alas very annoying problem.

When you use rune, potion, shovel, rope or whatever you get exhausted in all kinds of actions you can do.

For example, If you use a manapotion, you need to wait 1 entire second before you can open or move a corpse, or use a rope for that matter.

I've located the source of the exhaustion and it is "timeBetweenExActions" in config.lua.
Is there any way to set for example the potions on some other exhaust time?
I don't have the same problems with healing spells.

Thanks!
-- Fredrikli
 
I figured that but it seems like the server has hard-coded that you get exhausted in "timeBetweenExActions" whenever you use "onUse"

I solved it myself doing the following:
In game.cpp, in functions "playerUseItemEx" and "playerUseItem", create an if-statement around:
Code:
if (!player->canDoAction())
{
SchedulerTask* task = createSchedulerTask(player->getNextActionTime(),
boost::bind(&Game::playerUseItem, this, playerId, pos, stackpos, index, spriteId, isHotkey));
player->setNextActionTask(task);
returnfalse;
}
Use this statement:
Code:
if (!item->isContainer())
{
--PREVIOUS CODE GOES HERE (it's a bit different from function to function)
}

also, comment out or remove the same lines in function "playerMoveItem" (the lines including the if-statement "if (!player->canDoAction())").

Also, in actions.cpp, in functions "useItemEx" and "useItem" use the same if-statement around:
Code:
if (!player->canDoAction())
returnfalse;

so that it looks like this:
Code:
if (!item->isContainer())
{
if (!player->canDoAction())
returnfalse;
}

This fix only does so that you can open containers and move items during exhaust. You will still not be able to use rope or any other action until exhaust has expired.

Pardon my horrible english :D

Edit:
I use TFS for 10.10. Not quite sure which version. I just know it's not 1.0
 
Back
Top