summaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-09-19 15:41:28 -0400
committerShadowNinja <shadowninja@minetest.net>2015-04-20 22:48:14 -0400
commitd36067fda56dd47d1967e325cf8a8b711879527d (patch)
treeec7a2d146c644c27718f53aa76a2a669bd78a334 /src/convert_json.cpp
parent46a2c1f167f76b1ceb0164e9028b67eb6bf76e79 (diff)
downloadminetest-d36067fda56dd47d1967e325cf8a8b711879527d.tar.gz
minetest-d36067fda56dd47d1967e325cf8a8b711879527d.tar.bz2
minetest-d36067fda56dd47d1967e325cf8a8b711879527d.zip
Fix mod store rating
Diffstat (limited to 'src/convert_json.cpp')
-rw-r--r--src/convert_json.cpp16
1 files changed, 4 insertions, 12 deletions
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