aboutsummaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/convert_json.cpp')
-rw-r--r--src/convert_json.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/convert_json.cpp b/src/convert_json.cpp
index cea089623..e03508e21 100644
--- a/src/convert_json.cpp
+++ b/src/convert_json.cpp
@@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mods.h"
#include "config.h"
#include "log.h"
-#include "main.h" // for g_settings
#include "settings.h"
#include "httpfetch.h"
#include "porting.h"
@@ -357,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