From ad06853edfa5a428c32ba0fd189ace230bd75e54 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 21 Jun 2025 09:56:02 +0100 Subject: [PATCH] Fix suggesting unloaded commands in the "did you mean" message. --- src/command.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 32a0ee045..b2fcbb68e 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -229,12 +229,16 @@ namespace auto umessage = message.upper(); for (const auto &[command, info] : source.service->commands) { - if (info.hide || command == message) - continue; // Don't suggest a hidden alias or a missing command. + if (info.hide) + continue; // Don't suggest a hidden alias. size_t dist = Anope::Distance(umessage, command); if (dist < distance) { + ServiceReference cmd("Command", info.name); + if (!cmd) + continue; // Don't suggest an unloaded command. + distance = dist; similar = command; }