Skip to content

Commit 36693a7

Browse files
committed
fix: fix Player::setNbt
1 parent ecfc14b commit 36693a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/legacy/api/PlayerAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,9 +3000,9 @@ Local<Value> PlayerClass::getNbt(const Arguments& args) {
30003000
Player* player = get();
30013001
if (!player) return Local<Value>();
30023002

3003-
CompoundTag* tag = new CompoundTag();
3003+
std::unique_ptr<CompoundTag> tag = std::make_unique<CompoundTag>();
30043004
player->save(*tag);
3005-
return NbtCompoundClass::pack(tag);
3005+
return NbtCompoundClass::pack(std::move(tag));
30063006
}
30073007
CATCH("Fail in getNbt!")
30083008
}

0 commit comments

Comments
 (0)