@@ -22,7 +22,7 @@ struct EventData {
2222 std::string level_name;
2323 std::string level_creator;
2424 uint8_t coins = 0 ;
25- bool verified_coins = false ;
25+ uint8_t verified_coins = 0 ;
2626 bool platformer = false ;
2727 int level_id = -1 ;
2828 std::string levels_list;
@@ -34,10 +34,10 @@ struct matjson::Serialize<EventData> {
3434 static geode::Result<EventData> fromJson (matjson::Value const & value) {
3535 EventData data;
3636 if (value.contains (" demon" )) {
37- if (value[" demon" ].asInt ().isErr ()) {
37+ if (value[" demon" ].asUInt ().isErr ()) {
3838 GEODE_UNWRAP_INTO (data.demon , value[" demon" ].asBool ());
3939 } else {
40- GEODE_UNWRAP_INTO (auto demon, value[" demon" ].asInt ());
40+ GEODE_UNWRAP_INTO (auto demon, value[" demon" ].asUInt ());
4141 data.demon = demon == 1 ;
4242 }
4343 }
@@ -77,19 +77,13 @@ struct matjson::Serialize<EventData> {
7777 GEODE_UNWRAP_INTO (data.level_name , value[" level_name" ].asString ());
7878 GEODE_UNWRAP_INTO (data.level_creator , value[" level_creator" ].asString ());
7979 GEODE_UNWRAP_INTO (data.rate , value[" rate" ].asUInt ());
80- if (value.contains (" verified_coins" )) {
81- if (value[" verified_coins" ].asInt ().isErr ()) {
82- GEODE_UNWRAP_INTO (data.verified_coins , value[" verified_coins" ].asBool ());
83- } else {
84- GEODE_UNWRAP_INTO (auto verified_coins, value[" verified_coins" ].asInt ());
85- data.verified_coins = verified_coins == 1 ;
86- }
87- }
80+ GEODE_UNWRAP_INTO (data.coins , value[" coins" ].asUInt ());
81+ GEODE_UNWRAP_INTO (data.verified_coins , value[" verified_coins" ].asUInt ());
8882 if (value.contains (" platformer" )) {
89- if (value[" platformer" ].asInt ().isErr ()) {
83+ if (value[" platformer" ].asUInt ().isErr ()) {
9084 GEODE_UNWRAP_INTO (data.platformer , value[" platformer" ].asBool ());
9185 } else {
92- GEODE_UNWRAP_INTO (auto platformer, value[" platformer" ].asInt ());
86+ GEODE_UNWRAP_INTO (auto platformer, value[" platformer" ].asUInt ());
9387 data.platformer = platformer == 1 ;
9488 }
9589 }
0 commit comments