diff options
author | Aki <please@ignore.pl> | 2022-05-08 23:25:52 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-05-08 23:25:52 +0200 |
commit | 04a37fe8ae205afcdfbf83c0452324d4c9362bf3 (patch) | |
tree | 4b5b61c9038165dd9f08578e6176480de23148dc | |
parent | 8ad11975221b1448865400cab14a1560b71c6ade (diff) | |
download | derelict-04a37fe8ae205afcdfbf83c0452324d4c9362bf3.zip derelict-04a37fe8ae205afcdfbf83c0452324d4c9362bf3.tar.gz derelict-04a37fe8ae205afcdfbf83c0452324d4c9362bf3.tar.bz2 |
Dump source now loads location information
-rw-r--r-- | DumpSource.cpp | 8 |
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)); } |