From 1d18ba3358a12168cd4c2600aa19afc63de07189 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 20 Dec 2025 00:01:39 +0000 Subject: [PATCH] Fix RequireVersion to use an unsigned integer. --- include/modules.h | 2 +- src/modulemanager.cpp | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/modules.h b/include/modules.h index 5e14f41f0..3b84d2d65 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1271,7 +1271,7 @@ public: * @param minor The minor version * @param patch The patch version */ - static void RequireVersion(int major, int minor, int patch); + static void RequireVersion(unsigned major, unsigned minor, unsigned patch); /** Change the priority of one event in a module. * Each module event has a list of modules which are attached to that event type. If you wish to be called before or after other specific modules, you may use this diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 3ed0b20ea..927b36701 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -283,21 +283,17 @@ Module *ModuleManager::FindFirstOf(ModType type, bool ignoredeprecated) return NULL; } -void ModuleManager::RequireVersion(int major, int minor, int patch) +void ModuleManager::RequireVersion(unsigned major, unsigned minor, unsigned patch) { if (Anope::VersionMajor() > major) return; else if (Anope::VersionMajor() == major) { - if (minor == -1) - return; - else if (Anope::VersionMinor() > minor) + if (Anope::VersionMinor() > minor) return; else if (Anope::VersionMinor() == minor) { - if (patch == -1) - return; - else if (Anope::VersionPatch() > patch) + if (Anope::VersionPatch() > patch) return; else if (Anope::VersionPatch() == patch) return;