From 36693a7b379c5def900ba1bf6187a6c58de3a166 Mon Sep 17 00:00:00 2001 From: ShrBox Date: Mon, 5 Aug 2024 00:25:14 +0800 Subject: [PATCH] fix: fix Player::setNbt --- src/legacy/api/PlayerAPI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/legacy/api/PlayerAPI.cpp b/src/legacy/api/PlayerAPI.cpp index fa2e514..31e91af 100644 --- a/src/legacy/api/PlayerAPI.cpp +++ b/src/legacy/api/PlayerAPI.cpp @@ -3000,9 +3000,9 @@ Local PlayerClass::getNbt(const Arguments& args) { Player* player = get(); if (!player) return Local(); - CompoundTag* tag = new CompoundTag(); + std::unique_ptr tag = std::make_unique(); player->save(*tag); - return NbtCompoundClass::pack(tag); + return NbtCompoundClass::pack(std::move(tag)); } CATCH("Fail in getNbt!") }