Allow full circle rotation with 2degs step for plantlike drawtype.
[oweals/minetest.git] / src / convert_json.cpp
index c8e57aaf78c58687c61388748a4f117a48d53e8d..e79103a16c88d9e01170ba61e57f0eb7e1b04ca0 100644 (file)
@@ -31,20 +31,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "httpfetch.h"
 #include "porting.h"
 
-Json::Value                 fetchJsonValue(const std::string url,
-                                                                                                       struct curl_slist *chunk) {
-#if USE_CURL
+Json::Value                 fetchJsonValue(const std::string &url,
+               std::vector<std::string> *extra_headers) {
 
        HTTPFetchRequest fetchrequest;
        HTTPFetchResult fetchresult;
        fetchrequest.url = url;
        fetchrequest.caller = HTTPFETCH_SYNC;
 
-       struct curl_slist* runptr = chunk;
-       while(runptr) {
-               fetchrequest.extra_headers.push_back(runptr->data);
-               runptr = runptr->next;
-       }
+       if (extra_headers != NULL)
+               fetchrequest.extra_headers = *extra_headers;
+
        httpfetch_sync(fetchrequest,fetchresult);
 
        if (!fetchresult.succeeded) {
@@ -71,12 +68,12 @@ Json::Value                 fetchJsonValue(const std::string url,
        else {
                return root;
        }
-#endif
+
        return Json::Value();
 }
 
 std::vector<ModStoreMod>    readModStoreList(Json::Value& modlist) {
-       std::vector<ModStoreMod> retval;
+               std::vector<ModStoreMod> retval;
 
        if (modlist.isArray()) {
                for (unsigned int i = 0; i < modlist.size(); i++)