summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-05-08 23:25:52 +0200
committerAki <please@ignore.pl>2022-05-08 23:25:52 +0200
commit04a37fe8ae205afcdfbf83c0452324d4c9362bf3 (patch)
tree4b5b61c9038165dd9f08578e6176480de23148dc
parent8ad11975221b1448865400cab14a1560b71c6ade (diff)
downloadderelict-04a37fe8ae205afcdfbf83c0452324d4c9362bf3.zip
derelict-04a37fe8ae205afcdfbf83c0452324d4c9362bf3.tar.gz
derelict-04a37fe8ae205afcdfbf83c0452324d4c9362bf3.tar.bz2
Dump source now loads location information
-rw-r--r--DumpSource.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/DumpSource.cpp b/DumpSource.cpp
index 9c913d0..56b3336 100644
--- a/DumpSource.cpp
+++ b/DumpSource.cpp
@@ -1,8 +1,9 @@
#include "DumpSource.h"
#include <cmath>
-#include <vector>
+#include <string>
#include <utility>
+#include <vector>
#include <nlohmann/json.hpp>
#include <raylib.h>
@@ -36,6 +37,11 @@ DumpSource::DumpSource(const char* filename) :
info["victim"]["position"]["y"].get<long double>(),
info["victim"]["position"]["z"].get<long double>(),
};
+ auto id = info["solar_system_id"].get<long int>();
+ auto location = dump["locations"][std::to_string(id)];
+ km.location.system = location["name"].get<std::string>().data();
+ km.location.constellation = location["constellation"].get<std::string>().data();
+ km.location.region = location["region"].get<std::string>().data();
auto& grid = find_grid_for(m_grids, km.original);
grid.killmails.push_back(std::move(km));
}