1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Error when using CommandOverrideAdd() before MOD_LOAD,

since in MOD_INIT the command may not have been added yet thus
then you get silly module-load-order issues, such as in
previous commit 281d0cce9b
This commit is contained in:
Bram Matthys
2026-04-04 09:07:36 +02:00
parent 281d0cce9b
commit 945fb65759
+11 -1
View File
@@ -1148,7 +1148,17 @@ CommandOverride *CommandOverrideAdd(Module *module, const char *name, int priori
{
RealCommand *p;
CommandOverride *ovr;
if (module && (loop.config_status <= CONFIG_STATUS_INIT))
{
unreal_log(ULOG_ERROR, "module", "BUG_COMMANDOVERRIDEADD_NOT_MOD_LOAD", NULL,
"[BUG] CommandOverrideAdd() called by module '$module_name' before MOD_LOAD(). "
"This must be in MOD_LOAD(), otherwise the command to be overridden may not exist yet.",
log_data_string("module_name", module->header->name));
module->errorcode = MODERR_INVALID;
return NULL;
}
if (!(p = find_command_simple(name)))
{
if (module)