diff --git a/config/resources.txt b/config/resources.txt deleted file mode 100644 index 96803b09e..000000000 --- a/config/resources.txt +++ /dev/null @@ -1,2 +0,0 @@ -8 -250 500 250 500 500 500 1 0 \ No newline at end of file diff --git a/config/ressources.json b/config/ressources.json new file mode 100644 index 000000000..910a1e951 --- /dev/null +++ b/config/ressources.json @@ -0,0 +1,4 @@ +{ + // Price of each ressource in gold, in usual ressource order + "ressources_prices": [ 250, 500, 250, 500, 500, 500, 1, 0 ] +} diff --git a/lib/CObjectHandler.cpp b/lib/CObjectHandler.cpp index 352a376a6..03f20812c 100644 --- a/lib/CObjectHandler.cpp +++ b/lib/CObjectHandler.cpp @@ -196,18 +196,12 @@ void CObjectHandler::loadObjects() } tlog5 << "\t\tDone loading cregens!\n"; + const JsonNode config2(DATA_DIR "/config/ressources.json"); + BOOST_FOREACH(const JsonNode &price, config2["ressources_prices"].Vector()) { - int k = -1; - std::ifstream ifs(DATA_DIR "/config/resources.txt"); - ifs >> k; - int pom; - for(int i=0;i> pom; - resVals.push_back(pom); - } - tlog5 << "\t\tDone loading resource prices!\n"; + resVals.push_back(price.Float()); } + tlog5 << "\t\tDone loading resource prices!\n"; std::ifstream istr; istr.open(DATA_DIR "/config/bankconfig.txt", std::ios_base::binary);