From 7dcdf2df22e32cb0d9a7d53f2277f2408883b793 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sun, 10 Nov 2024 19:08:40 +0100 Subject: [PATCH] Fixed ScriptValue::to() for int and float types. --- source/mijin/types/script_value.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mijin/types/script_value.hpp b/source/mijin/types/script_value.hpp index 03674f3..b78463d 100644 --- a/source/mijin/types/script_value.hpp +++ b/source/mijin/types/script_value.hpp @@ -233,7 +233,7 @@ public: } else if constexpr (std::is_integral_v) { - return toInt().then([](script_int_t val) { return static_cast(val); }); + return toInt().then([](script_int_t val) -> Optional> { return static_cast(val); }); } else if constexpr (std::is_same_v) { @@ -241,7 +241,7 @@ public: } else if constexpr (std::is_floating_point_v) { - return toFloat().then([](script_float_t val) { return static_cast(val); }); + return toFloat().then([](script_float_t val) -> Optional> { return static_cast(val); }); } else if constexpr (std::is_same_v) {