Ü 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
Could you help me bro? I need it urgentlyXD easy set this change (optional)
void Game::playerMoveCreature(Player* player, Creature* movingCreature, const Position& movingCreatureOrigPos, Tile* toTile)
uint32_t delay = player->getNextActionTime();
SchedulerTask* task = createSchedulerTask(delay, std::bind(&Game::playerMoveCreatureByID,
SchedulerTask* task = createSchedulerTask(1500, std::bind(&Game::playerMoveCreatureByID, this,
if(Creature* movingCreature = thing->getCreature())
{
if(player->getAttackedCreature())
{
player->sendCancelMessage(RET_NOTPOSSIBLE);
return false;
}
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
in game.cpp after
addC++:if(Creature* movingCreature = thing->getCreature()) {
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)
Where do I put that line?remove ::: uint32_t delay = player->getNextActionTime();
You can check line #649 here (ve la linea #649 en el link de abajo)@MartyX Pero no me funciona, me podrías ayudar? sigue sin empujar cuando el player está atacando
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;
}