From: ShadowNinja Date: Fri, 19 Sep 2014 19:41:28 +0000 (-0400) Subject: Fix mod store rating X-Git-Tag: 0.4.13~349 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d36067fda56dd47d1967e325cf8a8b711879527d;p=oweals%2Fminetest.git Fix mod store rating --- diff --git a/src/convert_json.cpp b/src/convert_json.cpp index 68912d482..e03508e21 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -356,18 +356,10 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) { } //value - if (details["rating"].asString().size()) { - - std::string id_raw = details["rating"].asString(); - char* endptr = 0; - float numbervalue = strtof(id_raw.c_str(),&endptr); - - if ((id_raw != "") && (*endptr == 0)) { - retval.rating = numbervalue; - } - } - else { - retval.rating = 0.0; + if (details["value"].isInt()) { + retval.rating = details["value"].asInt(); + } else { + retval.rating = 0; } //depends