Advertisement
Guest User

Untitled

a guest
Apr 18th, 2011
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. void World::LoadMine()
  2. {
  3.     this->mine_drops.clear();
  4.  
  5.     UTIL_UNORDERED_MAP_FOREACH_ALL(this->mining_config, std::string, util::variant, hc)
  6.     {
  7.         std::vector<std::string> parts = util::explode(',', static_cast<std::string>(hc.second));
  8.  
  9.         if (parts.size() != 3)
  10.         {
  11.             Console::Wrn("skipping invalid mine drop data for item #%i", util::to_int(hc.first));
  12.             continue;
  13.         }
  14.  
  15.         Mine_Drop *drop(new Mine_Drop);
  16.         drop->item = util::to_int(hc.first);
  17.         drop->chance = util::to_float(parts[0]);
  18.         drop->levelreq = util::to_int(parts[1]);
  19.         drop->exp = util::to_int(parts[2]);
  20.         this->mine_drops.push_back(drop);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement