From 6745473ac3057fbbf2e46f16782a62e5340997ff Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 24 Feb 2023 00:39:45 +0100 Subject: [PATCH] Fix LUI std::optional + cleanup --- src/client/game/ui_scripting/script_value.cpp | 10 ---------- src/client/game/ui_scripting/script_value.hpp | 16 +++------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/client/game/ui_scripting/script_value.cpp b/src/client/game/ui_scripting/script_value.cpp index 85a70e6b..5169ae9b 100644 --- a/src/client/game/ui_scripting/script_value.cpp +++ b/src/client/game/ui_scripting/script_value.cpp @@ -437,16 +437,6 @@ namespace ui_scripting return this->get_raw().v.native == other.get_raw().v.native; } - arguments script_value::operator()() const - { - return this->as()(); - } - - arguments script_value::operator()(const arguments& arguments) const - { - return this->as()(arguments); - } - function_argument::function_argument(const arguments& args, const script_value& value, const int index) : values_(args) , value_(value) diff --git a/src/client/game/ui_scripting/script_value.hpp b/src/client/game/ui_scripting/script_value.hpp index 316c269d..edb0cb90 100644 --- a/src/client/game/ui_scripting/script_value.hpp +++ b/src/client/game/ui_scripting/script_value.hpp @@ -136,24 +136,14 @@ namespace ui_scripting { } - template - script_value(const std::optional optional) + template + script_value(const std::optional& optional) + : script_value(optional.has_value() ? script_value(optional.value()) : script_value()) { - if (optional.has_value()) - { - script_value::script_value(optional.value()); - } - else - { - script_value::script_value(); - } } bool operator==(const script_value& other) const; - arguments operator()() const; - arguments operator()(const arguments& arguments) const; - template arguments operator()(T... arguments) const {