mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix mod store rating
This commit is contained in:
parent
46a2c1f167
commit
d36067fda5
1 changed files with 4 additions and 12 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue