🐛 long val was being cast to unsigned instead of signed

This commit is contained in:
EntireTwix 2021-04-09 19:57:19 -07:00
parent 7ce3c0f7d4
commit 1048ed9353

View file

@ -15,13 +15,13 @@ template <typename T>
INLINE Json::Value JsonReturn(T &&val) INLINE Json::Value JsonReturn(T &&val)
{ {
Json::Value res; Json::Value res;
if constexpr (std::is_same_v<T, bool>) if constexpr (std::is_same_v<T, int_fast8_t>)
{ {
res["value"] = (int)val; //becuase of json lib interpreting 67 as 'A' for example res["value"] = (int)val; //becuase of json lib interpreting 67 as 'A' for example
} }
else if constexpr (std::is_same_v<T, long>) else if constexpr (std::is_same_v<T, long>)
{ {
res["value"] = (Json::UInt64)val; res["value"] = (Json::Int64)val;
} }
else else
{ {