summaryrefslogtreecommitdiffhomepage
path: root/DumpSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'DumpSource.cpp')
-rw-r--r--DumpSource.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/DumpSource.cpp b/DumpSource.cpp
index cfcd9f0..57f81db 100644
--- a/DumpSource.cpp
+++ b/DumpSource.cpp
@@ -3,6 +3,7 @@
#include <ctime>
#include <sstream>
#include <string>
+#include <unordered_map>
#include <vector>
#include <nlohmann/json.hpp>
@@ -29,7 +30,14 @@ DumpSource::DumpSource(const char* filename) :
throw "File does not exist";
char* text = LoadFileText(filename);
auto dump = json::parse(text);
+ std::unordered_map<long int, long int> group_lookup;
+ for (const auto& item : dump["types"]) {
+ const auto type_id = item["type_id"].get<long int>();
+ item["group_id"].get_to(group_lookup[type_id]);
+ }
dump.at("killmails").get_to(m_killmails);
+ for (auto& km : m_killmails)
+ km.group = group_lookup[km.ship];
UnloadFileText(text);
}