Skip to content

Commit

Permalink
fix: CommandSoftEnumRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Aug 3, 2024
1 parent 39acfab commit b9a6ecf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions include/bedrock/server/commands/command_soft_enum_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@
class CommandSoftEnumRegistry {
public:
CommandSoftEnumRegistry() = default;
CommandSoftEnumRegistry(const CommandSoftEnumRegistry &other) = default;
explicit CommandSoftEnumRegistry(CommandRegistry *registry) : registry_(registry) {}

#ifdef __linux__
CommandSoftEnumRegistry(const CommandSoftEnumRegistry &other)
{
registry_ = other.registry_;
};
CommandSoftEnumRegistry &operator=(const CommandSoftEnumRegistry &other) = default;
#endif

CommandRegistry *registry{nullptr};
private:
CommandRegistry *registry_ = nullptr;
};
2 changes: 1 addition & 1 deletion src/endstone_core/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void EndstoneServer::setScoreboard(std::unique_ptr<EndstoneScoreboard> scoreboar

std::shared_ptr<Scoreboard> EndstoneServer::getNewScoreboard()
{
CommandSoftEnumRegistry registry;
auto registry = CommandSoftEnumRegistry();
auto board = ServerScoreboard::create(registry, nullptr, level_->getHandle()._getGameplayUserManagerStackRef());
board->setPacketSender(level_->getHandle().getPacketSender());
auto result = std::make_shared<EndstoneScoreboard>(std::move(board));
Expand Down

0 comments on commit b9a6ecf

Please sign in to comment.