Implement redeem codes

This commit is contained in:
Kamil
2020-12-17 01:03:38 +01:00
committed by Gent S
parent a74c9be2ff
commit 34dbb59fb1
4 changed files with 53 additions and 0 deletions

View File

@@ -578,6 +578,12 @@ void TableData::loadDrops() {
ItemManager::NanoCapsules[(int)capsule["Crate"]] = (int)capsule["Nano"];
}
#endif
nlohmann::json codes = dropData["Codes"];
for (nlohmann::json::iterator _code = codes.begin(); _code != codes.end(); _code++) {
auto code = _code.value();
std::pair<int32_t, int32_t> item = std::make_pair((int)code["Id"], (int)code["Type"]);
ItemManager::CodeItems[code["Code"]] = item;
}
std::cout << "[INFO] Loaded " << ItemManager::Crates.size() << " Crates containing "
<< itemCount << " items" << std::endl;