From a8cea91af9a1c0279ad384da7acce2c31e556d47 Mon Sep 17 00:00:00 2001 From: OEOTYAN Date: Sun, 13 Oct 2024 01:40:51 +0800 Subject: [PATCH] fix: fix dataitem constexpr --- src/mc/world/actor/DataItem.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mc/world/actor/DataItem.h b/src/mc/world/actor/DataItem.h index 7dd83c49cb..031ab13e72 100644 --- a/src/mc/world/actor/DataItem.h +++ b/src/mc/world/actor/DataItem.h @@ -31,16 +31,16 @@ class DataItem { template requires(DataItem::TypeList::contains>) - [[nodiscard]] static constexpr std::unique_ptr create(ushort key, T&& value); - [[nodiscard]] static constexpr std::unique_ptr create(ushort key, bool value) { + [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr create(ushort key, T&& value); + [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr create(ushort key, bool value) { return create(key, (schar)value); } template requires(DataItem::TypeList::contains>) - [[nodiscard]] static constexpr std::unique_ptr create(::ActorDataIDs key, T&& value) { + [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr create(::ActorDataIDs key, T&& value) { return create(static_cast>(key), std::forward(value)); } - [[nodiscard]] static constexpr std::unique_ptr create(::ActorDataIDs key, bool value) { + [[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr create(::ActorDataIDs key, bool value) { return create(key, (schar)value); } @@ -117,6 +117,6 @@ constexpr bool DataItem::setData(T&& value) { template requires(DataItem::TypeList::contains>) -constexpr std::unique_ptr DataItem::create(ushort key, T&& value) { +LL_CONSTEXPR23 std::unique_ptr DataItem::create(ushort key, T&& value) { return std::make_unique>>(key, std::forward(value)); }