Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
this, player->getID(), listDir)));
SchedulerTask* task = createSchedulerTask(player->getStepDuration(),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos));
Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
this, player->getID(), listDir)));
SchedulerTask* task = createSchedulerTask(player->getStepDuration()+g_config.getNumber(ConfigManager::PUSH_CREATURE_DELAY),
boost::bind(&Game::playerMoveCreature, this, playerId...
Such thing happens only if you are doing it as a GM. Check your data/XML/groups.xmlalready edited config it works fine when i'm close to other character it takes 2 seconds but when im far away (from distance ) it takes 0 seconds
Very inaccurate information.Such thing happens only if you are doing it as a GM. Check your data/XML/groups.xml
Keep in mind, when you are a normal character, and you push someone who is few sqm away from you, then your character dashes into this creature and pushes it without delay. Such behavior was always on both Open Tibia and on RL Cipsoft's Tibia. Always, and this isn't a bug!
Also on RL Tibia there's technique to push character even 2 SQM at once without delay. Just look for some videos 'how to pk push' etc.
Very inaccurate information.
The distance push is bugged in 0.4 r3777 everybody knows it.
By default the distance push is supposed to scale down the delay depending on the distance between the pusher and the target.
With this rev 1 sqm distance will remove the delay completely, which is not how tibia normally works.
On RL Tibia there's techniques to push a character 10 sqm without delay, so what? it's not relevant.
but what do I know, after all your knowledge is lightyears ahead of mine.
bool Game::playerMoveCreature(uint32_t playerId, uint32_t movingCreatureId,
const Position& movingCreaturePos, const Position& toPos, bool delay)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved() || player->hasFlag(PlayerFlag_CannotMoveCreatures))
return false;
if(!player->canDoAction())
{
SchedulerTask* task = createSchedulerTask(player->getNextActionTime(),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, true));
player->setNextActionTask(task);
return false;
}
Creature* movingCreature = getCreatureByID(movingCreatureId);
if(!movingCreature || movingCreature->isRemoved() || !player->canSeeCreature(movingCreature))
return false;
player->setNextActionTask(NULL);
if(!Position::areInRange<1,1,0>(movingCreaturePos, player->getPosition()) && !player->hasCustomFlag(PlayerCustomFlag_CanMoveFromFar))
{
//need to walk to the creature first before moving it
std::list<Direction> listDir;
if(getPathToEx(player, movingCreaturePos, listDir, 0, 1, true, true))
{
Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
this, player->getID(), listDir)));
SchedulerTask* task = createSchedulerTask(std::max((int32_t)SCHEDULER_MINTICKS, player->getStepDuration()),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, true));
player->setNextWalkActionTask(task);
return true;
}
player->sendCancelMessage(RET_THEREISNOWAY);
return false;
}
else if(delay)
{
uint32_t delayTime = g_config.getNumber(ConfigManager::PUSH_CREATURE_DELAY);
if(delayTime > 0)
{
SchedulerTask* task = createSchedulerTask(delayTime,
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, false));
player->setNextActionTask(task);
return true;
}
}
SchedulerTask* task = createSchedulerTask(std::max((int32_t)SCHEDULER_MINTICKS, player->getStepDuration()),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos, true));
i tried to edit it in game.cpp and complie but it didn't work :/Changing this would be a source edit. Are you willing to do a source edit?
I edited my above post. Hope it helps.i tried to edit it in game.cpp and complie but it didn't work :/
mine code is different here it is :I edited my above post. Hope it helps.
if(Creature* movingCreature = thing->getCreature())
{
uint32_t
= g_config.getNumber(ConfigManager::PUSH_CREATURE_DELAY);
if(Position::areInRange<1,1,0>(movingCreature->getPosition(), player->getPosition()) && delay > 0
&& !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
{
SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::playerMoveCreature, this,
player->getID(), movingCreature->getID(), movingCreature->getPosition(), toCylinder->getPosition()));
player->setNextActionTask(task);
}
else
playerMoveCreature(playerId, movingCreature->getID(), movingCreature->getPosition(), toCylinder->getPosition());
}
else if(thing->getItem())
playerMoveItem(playerId, fromPos, spriteId, fromStackpos, toPos, count);
return true;
}
bool Game::playerMoveCreature(uint32_t playerId, uint32_t movingCreatureId,
const Position& movingCreaturePos, const Position& toPos)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved() || player->hasFlag(PlayerFlag_CannotMoveCreatures))
return false;
if(!player->canDoAction())
{
uint32_t delay = player->getNextActionTime();
SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::playerMoveCreature,
this, playerId, movingCreatureId, movingCreaturePos, toPos));
player->setNextActionTask(task);
return false;
}
Creature* movingCreature = getCreatureByID(movingCreatureId);
if(!movingCreature || movingCreature->isRemoved() || movingCreature->getNoMove())
return false;
player->setNextActionTask(NULL);
if(!Position::areInRange<1,1,0>(movingCreaturePos, player->getPosition()) && !player->hasCustomFlag(PlayerCustomFlag_CanMoveFromFar))
{
//need to walk to the creature first before moving it
std::list<Direction> listDir;
if(getPathToEx(player, movingCreaturePos, listDir, 0, 1, true, true))
{
Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
this, player->getID(), listDir)));
SchedulerTask* task = createSchedulerTask(player->getStepDuration(),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos));
player->setNextWalkActionTask(task);
return true;
}
player->sendCancelMessage(RET_THEREISNOWAY);
return false;
}
By default the distance push is supposed to scale down the delay depending on the distance between the pusher and the target.
Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
this, player->getID(), listDir)));
SchedulerTask* task = createSchedulerTask(player->getStepDuration(),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos));
Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
this, player->getID(), listDir)));
SchedulerTask* task = createSchedulerTask(player->getStepDuration()+g_config.getNumber(ConfigManager::PUSH_CREATURE_DELAY),
boost::bind(&Game::playerMoveCreature, this, playerId, movingCreatureId, movingCreaturePos, toPos));