• 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!

Bug PUSH on TARGET OTX 3.7 TFS 1.3

Ü Pendragon

Member
Joined
Apr 10, 2017
Messages
51
Reaction score
6
I need your help, the player when he is attacking can not push correctly, he has to stop attacking to push. Help please <3
 
for a push require edit lines on game.cpp
C++:
void Game::playerMoveCreature(Player* player, Creature* movingCreature, const Position& movingCreatureOrigPos, Tile* toTile)

find and remove it:
C++:
uint32_t delay = player->getNextActionTime();

and find and change "delay" for your value liked (1000 - 1500 - 2000) etc:
C++:
SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerMoveCreatureByID,

and find and change "1500" for a (100) for a value liked for you:
C++:
SchedulerTask* task = createSchedulerTask(1500, std::bind(&Game::playerMoveCreatureByID, this,

that maybe it can work for you "push"

already to attack occupies think something else out there
 
in game.cpp after
C++:
if(Creature* movingCreature = thing->getCreature())
    {
add
C++:
if(player->getAttackedCreature())
{
        player->sendCancelMessage(RET_NOTPOSSIBLE);
        return false;
}

and if you want to specify that you cannot push creature that you are attacking, then go with
C++:
if(player->getAttackedCreature() == movingCreature)
 
for a push require edit lines on game.cpp
C++:
void Game::playerMoveCreature(Player* player, Creature* movingCreature, const Position& movingCreatureOrigPos, Tile* toTile)

find and remove it:
C++:
uint32_t delay = player->getNextActionTime();

and find and change "delay" for your value liked (1000 - 1500 - 2000) etc:
C++:
SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerMoveCreatureByID,

and find and change "1500" for a (100) for a value liked for you:
C++:
SchedulerTask* task = createSchedulerTask(1500, std::bind(&Game::playerMoveCreatureByID, this,

that maybe it can work for you "push"

already to attack occupies think something else out there

I did it as you indicated and it does not compile.
'delay': undeclared identifier
 
in game.cpp after
C++:
if(Creature* movingCreature = thing->getCreature())
    {
add
C++:
if(player->getAttackedCreature())
{
        player->sendCancelMessage(RET_NOTPOSSIBLE);
        return false;
}

and if you want to specify that you cannot push creature that you are attacking, then go with
C++:
if(player->getAttackedCreature() == movingCreature)
  1. if(Creature* movingCreature = thing->getCreature())
  2. {
That code is not found in my source.
 
@MartyX Pero no me funciona, me podrías ayudar? sigue sin empujar cuando el player está atacando
You can check line #649 here (ve la linea #649 en el link de abajo)

Code:
void Game::playerMoveCreature(Player* player, Creature* movingCreature, const Position& movingCreatureOrigPos, Tile* toTile)
{
    if (!player->canDoAction()) {
        uint32_t delay = player->getNextActionTime();
        SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerMoveCreatureByID,
            this, player->getID(), movingCreature->getID(), movingCreatureOrigPos, toTile->getPosition()));
        player->setNextActionTask(task);
        return;
    }

That is the complete playerMoveCreature function. Regards!
 
Back
Top