Skip to content

Commit

Permalink
fix: fix Player::setNbt
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Aug 4, 2024
1 parent ecfc14b commit 36693a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/legacy/api/PlayerAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3000,9 +3000,9 @@ Local<Value> PlayerClass::getNbt(const Arguments& args) {
Player* player = get();
if (!player) return Local<Value>();

CompoundTag* tag = new CompoundTag();
std::unique_ptr<CompoundTag> tag = std::make_unique<CompoundTag>();
player->save(*tag);
return NbtCompoundClass::pack(tag);
return NbtCompoundClass::pack(std::move(tag));
}
CATCH("Fail in getNbt!")
}
Expand Down

0 comments on commit 36693a7

Please sign in to comment.