projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46a2c1f
)
Fix mod store rating
author
ShadowNinja
<shadowninja@minetest.net>
Fri, 19 Sep 2014 19:41:28 +0000
(15:41 -0400)
committer
ShadowNinja
<shadowninja@minetest.net>
Tue, 21 Apr 2015 02:48:14 +0000
(22:48 -0400)
src/convert_json.cpp
patch
|
blob
|
history
diff --git
a/src/convert_json.cpp
b/src/convert_json.cpp
index 68912d482de84a496b9851fdd55593b407f1f3fb..e03508e21fe2d0a77a76013d3f3a79a3168c9a0c 100644
(file)
--- a/
src/convert_json.cpp
+++ b/
src/convert_json.cpp
@@
-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