Advertisement
Guest User

Untitled

a guest
Apr 5th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.65 KB | None | 0 0
  1. Open the game.cpp file from your source and look for the following function.
  2.  
  3.  
  4. bool Game::playerMove(uint32_t playerId, Direction dir)
  5. Se sua source for OTX2 a função completa deve estar desta maneira.
  6.  
  7.  
  8. bool Game::playerMove(uint32_t playerId, Direction dir)
  9. {
  10.     Player* player = getPlayerByID(playerId);
  11.     if(!player || player->isRemoved())
  12.         return false;
  13.  
  14.     player->setIdleTime(0);
  15.     if(player->getNoMove())
  16.     {
  17.         player->sendCancelWalk();
  18.         return false;
  19.     }
  20.  
  21.     std::list<Direction> dirs;
  22.     dirs.push_back(dir);
  23.  
  24.     player->setNextWalkActionTask(NULL);
  25.     return player->startAutoWalk(dirs);
  26. }
  27. Look for the following line in the code.
  28.  
  29. player->setNextWalkActionTask(NULL);
  30. E adicione essa linha logo acima.
  31.  
  32.  
  33. if(!g_config.getBool(ConfigManager::PUSH_CRUZADO))
  34. The full function should look like this:
  35.  
  36.  
  37. bool Game::playerMove(uint32_t playerId, Direction dir)
  38. {
  39.     Player* player = getPlayerByID(playerId);
  40.     if(!player || player->isRemoved())
  41.         return false;
  42.  
  43.     player->setIdleTime(0);
  44.     if(player->getNoMove())
  45.     {
  46.         player->sendCancelWalk();
  47.         return false;
  48.     }
  49.  
  50.     std::list<Direction> dirs;
  51.     dirs.push_back(dir);
  52.      
  53.     if(!g_config.getBool(ConfigManager::PUSH_CRUZADO))
  54.         player->setNextWalkActionTask(NULL);
  55.    
  56.     return player->startAutoWalk(dirs);
  57. }
  58. After that, add the following line to the configmanager.cpp file inside the bool function ConfigManager :: load ()
  59.  
  60.  
  61. m_confBool[PUSH_CRUZADO] = getGlobalBool("PushCruzado", false);
  62. In the configmanager.h file look for enum bool_config_t and you will see a list, add the line below in this list
  63.  
  64. 
  65. PUSH_CRUZADO,
  66. Now in your config.lua add:
  67.  
  68.  
  69. PushCruzado = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement