Skip to content

Commit d36067f

Browse files
committedApr 21, 2015
Fix mod store rating
1 parent 46a2c1f commit d36067f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed
 

Diff for: ‎src/convert_json.cpp

+4-12
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,10 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) {
356356
}
357357

358358
//value
359-
if (details["rating"].asString().size()) {
360-
361-
std::string id_raw = details["rating"].asString();
362-
char* endptr = 0;
363-
float numbervalue = strtof(id_raw.c_str(),&endptr);
364-
365-
if ((id_raw != "") && (*endptr == 0)) {
366-
retval.rating = numbervalue;
367-
}
368-
}
369-
else {
370-
retval.rating = 0.0;
359+
if (details["value"].isInt()) {
360+
retval.rating = details["value"].asInt();
361+
} else {
362+
retval.rating = 0;
371363
}
372364

373365
//depends

0 commit comments

Comments
 (0)
Please sign in to comment.