Skip to content

Commit

Permalink
fix: fix dataitem constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Oct 12, 2024
1 parent de5c473 commit a8cea91
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mc/world/actor/DataItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ class DataItem {

template <typename T>
requires(DataItem::TypeList::contains<std::remove_cvref_t<T>>)
[[nodiscard]] static constexpr std::unique_ptr<DataItem> create(ushort key, T&& value);
[[nodiscard]] static constexpr std::unique_ptr<DataItem> create(ushort key, bool value) {
[[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(ushort key, T&& value);
[[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(ushort key, bool value) {
return create(key, (schar)value);
}
template <typename T>
requires(DataItem::TypeList::contains<std::remove_cvref_t<T>>)
[[nodiscard]] static constexpr std::unique_ptr<DataItem> create(::ActorDataIDs key, T&& value) {
[[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(::ActorDataIDs key, T&& value) {
return create(static_cast<std::underlying_type_t<::ActorDataIDs>>(key), std::forward<T>(value));
}
[[nodiscard]] static constexpr std::unique_ptr<DataItem> create(::ActorDataIDs key, bool value) {
[[nodiscard]] static LL_CONSTEXPR23 std::unique_ptr<DataItem> create(::ActorDataIDs key, bool value) {
return create(key, (schar)value);
}

Expand Down Expand Up @@ -117,6 +117,6 @@ constexpr bool DataItem::setData(T&& value) {

template <typename T>
requires(DataItem::TypeList::contains<std::remove_cvref_t<T>>)
constexpr std::unique_ptr<DataItem> DataItem::create(ushort key, T&& value) {
LL_CONSTEXPR23 std::unique_ptr<DataItem> DataItem::create(ushort key, T&& value) {
return std::make_unique<DataItem2<std::remove_cvref_t<T>>>(key, std::forward<T>(value));
}

0 comments on commit a8cea91

Please sign in to comment.