Fix mod store rating
parent
46a2c1f167
commit
d36067fda5
|
@ -356,18 +356,10 @@ ModStoreModDetails readModStoreModDetails(Json::Value& details) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//value
|
//value
|
||||||
if (details["rating"].asString().size()) {
|
if (details["value"].isInt()) {
|
||||||
|
retval.rating = details["value"].asInt();
|
||||||
std::string id_raw = details["rating"].asString();
|
} else {
|
||||||
char* endptr = 0;
|
retval.rating = 0;
|
||||||
float numbervalue = strtof(id_raw.c_str(),&endptr);
|
|
||||||
|
|
||||||
if ((id_raw != "") && (*endptr == 0)) {
|
|
||||||
retval.rating = numbervalue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
retval.rating = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//depends
|
//depends
|
||||||
|
|
Loading…
Reference in New Issue