Forráskód Böngészése

fix: don't try to read non-json files as json

Sam Jaffe 1 éve
szülő
commit
9d11ce65fc
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      include/engine/universe.tpp

+ 1 - 0
include/engine/universe.tpp

@@ -24,6 +24,7 @@ void Universe::load(std::string const & name, std::string const & fallback) {
   if (!fs::exists(location)) { return; }
 
   auto import = [this](fs::path const & file) {
+    if (file.extension() != "json") { return; }
     Json::Value json;
     std::ifstream in(file.string());
     in >> json;