mirror of
https://github.com/moparisthebest/minetest
synced 2024-12-22 23:58:48 -05:00
Fix mod store rating
This commit is contained in:
parent
46a2c1f167
commit
d36067fda5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user