Advertisement
Guest User

battleground.cpp

a guest
Jan 31st, 2014
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. uint8 Battleground::ClickFastStart(Player *player, GameObject *go)
  2. {
  3. if (!isArena())
  4. return 0;
  5.  
  6. std::set<uint64>::iterator pIt = m_playersWantsFastStart.find(player->GetGUID());
  7. if (pIt != m_playersWantsFastStart.end() || GetStartDelayTime() < BG_START_DELAY_15S)
  8. return m_playersWantsFastStart.size();
  9.  
  10. m_playersWantsFastStart.insert(player->GetGUID());
  11.  
  12. std::set<GameObject*>::iterator goIt = m_crystals.find(go);
  13. if (goIt == m_crystals.end())
  14. m_crystals.insert(go);
  15.  
  16. uint8 playersNeeded = 0;
  17. switch(GetArenaType())
  18. {
  19. case ARENA_TYPE_2v2:
  20. playersNeeded = 4;
  21. break;
  22. case ARENA_TYPE_3v3:
  23. playersNeeded = 6;
  24. break;
  25. case ARENA_TYPE_5v5:
  26. playersNeeded = 10;
  27. break;
  28. }
  29.  
  30.  
  31. if (m_playersWantsFastStart.size() == playersNeeded)
  32. {
  33. DespawnCrystals();
  34. SetStartDelayTime(BG_START_DELAY_15S);
  35. }
  36.  
  37. return m_playersWantsFastStart.size();
  38. }
  39.  
  40. void Battleground::DespawnCrystals()
  41. {
  42. if (m_crystals.empty())
  43. return;
  44. /*
  45. for (std::set<GameObject*>::iterator itr = m_crystals.begin(); itr != m_crystals.end(); itr)
  46. {
  47.  
  48. }*/
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement