diff --git a/src/ll/core/Config.h b/src/ll/core/Config.h index 7edababc00..1e500113d7 100644 --- a/src/ll/core/Config.h +++ b/src/ll/core/Config.h @@ -15,7 +15,7 @@ namespace ll { struct LeviConfig { - int version = 30; + int version = 31; std::string language = "system"; struct { @@ -24,9 +24,7 @@ struct LeviConfig { CommandPermissionLevel permission = CommandPermissionLevel::GameDirectors; }; struct { - struct { - bool enabled = true; - } tpdimOverload{}; + CmdSetting tpdimCommand{}; CmdSetting crashCommand{false}; CmdSetting versionCommand{}; CmdSetting memstatsCommand{true, CommandPermissionLevel::Host}; diff --git a/src/ll/core/command/BuiltinCommands.cpp b/src/ll/core/command/BuiltinCommands.cpp index 39fa19338a..7e437b3ef6 100644 --- a/src/ll/core/command/BuiltinCommands.cpp +++ b/src/ll/core/command/BuiltinCommands.cpp @@ -7,7 +7,7 @@ namespace ll::command { LL_TYPE_INSTANCE_HOOK( - registerBuiltinCommands, + RegisterBuiltinCommands, ll::memory::HookPriority::Highest, ServerInstanceEventCoordinator, &ServerInstanceEventCoordinator::sendServerInitializeEnd, @@ -15,20 +15,11 @@ LL_TYPE_INSTANCE_HOOK( ::ServerInstance& ins ) { origin(ins); + registerTpdimCommand(); registerVersionCommand(); registerMemstatsCommand(); registerCrashCommand(); registerModManageCommand(); } -LL_STATIC_HOOK( - registerTpdimCommands, - ll::memory::HookPriority::Normal, - &TeleportCommand::setup, - void, - CommandRegistry& registry -) { - origin(registry); - registerTpdimCommand(); -} -void registerCommands() { static memory::HookRegistrar hooks{}; } +void registerCommands() { static memory::HookRegistrar hooks{}; } } // namespace ll::command diff --git a/src/ll/core/command/Teleport.cpp b/src/ll/core/command/Teleport.cpp index dae84c1b9f..183582c94c 100644 --- a/src/ll/core/command/Teleport.cpp +++ b/src/ll/core/command/Teleport.cpp @@ -30,11 +30,13 @@ struct TpTarget { }; void registerTpdimCommand() { - auto config = ll::getLeviConfig().modules.command.tpdimOverload; + auto config = ll::getLeviConfig().modules.command.tpdimCommand; if (!config.enabled) { return; } - auto& cmd = CommandRegistrar::getInstance().getOrCreateCommand("tp"); + auto& cmd = CommandRegistrar::getInstance() + .getOrCreateCommand("teleportdim", "commands.tp.description", config.permission) + .alias("tpdim"); cmd.overload() .required("destination")