Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. void Resolver::resolve(ClientFrameStage_en stage)
  2. {
  3. if (!p_Engine->isIG())
  4. return;
  5.  
  6. if (!Global::locPlayer || Global::locPlayer == NULL)
  7. return;
  8.  
  9. if (stage == ClientFrameStage_en::FRAME_NET_UPDATE_POSTDATAUPDATE_START)
  10. {
  11. for (int i = 1; i < p_GlobVars->maxClients; i++)
  12. {
  13. Entity *player = reinterpret_cast<Entity*>(p_ClientEntList->GetClientEntity(i));
  14.  
  15. if (!player || player == nullptr)
  16. continue;
  17.  
  18. if (player == Global::locPlayer)
  19. continue;
  20.  
  21. if (player->isStationary())
  22. continue;
  23.  
  24. if (player->isImmune())
  25. continue;
  26.  
  27. if (player->getLeben() <= 0)
  28. continue;
  29.  
  30. if (player->getTeam() == Global::locPlayer->getTeam())
  31. continue;
  32.  
  33. playerinfo_t playerInfo;
  34. p_Engine->getPlyrInfo(i, &playerInfo);
  35.  
  36. if (!mVars.bEnableResolve && std::find(resolvingPlayers.begin(), resolvingPlayers.end(), playerInfo.xuid) == resolvingPlayers.end())
  37. continue;
  38.  
  39. data.push_back(std::pair<Entity*, Vector3>(player, player->getEyeAechse()));
  40.  
  41. player->getEyeAechse().yAechse = player->getLowBodYtarg();
  42.  
  43. // ~ deleted parts cause pub release
  44.  
  45. if (IsEntityMoving(player))
  46. {
  47. player->getEyeAechse().yAechse = player->getLowBodYtarg();
  48. //p_Console->ConsoleColorPrintf(Color::Blue(), "IsEntityMoving: true\n");
  49. }
  50. else
  51. {
  52. player->getEyeAechse().yAechse = player->getLowBodYtarg() + 180.f; // nice meme :D
  53. //p_Console->ConsoleColorPrintf(Color(255, 119, 0, 255), "else: true\n");
  54. }
  55. }
  56. }
  57. else if (stage == ClientFrameStage_en::FRAME_RENDER_END)
  58. {
  59. for (size_t i = 0; i < data.size(); i++)
  60. {
  61. std::pair<Entity*, Vector3> cur = data.at(i);
  62. cur.first->getEyeAechse() = cur.second;
  63. }
  64. data.clear();
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement