From f8f7eca9c870f02230e88ae9a157731c3afb6458 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Tue, 1 Feb 2011 21:23:41 -0700 Subject: [PATCH] Check if the module already exists. --- src/Core/IRC.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Core/IRC.pm b/src/Core/IRC.pm index 20881fc..cc727b6 100644 --- a/src/Core/IRC.pm +++ b/src/Core/IRC.pm @@ -47,6 +47,13 @@ sub cmd_modload return 0; } + # Check if the module is already loaded. + if (API::Std::mod_exists($argv[0])) { + notice($data{svr}, $data{nick}, "Module \002".$argv[0]."\002 is already loaded."); + return 0; + } + + # Go for it! my $tn = Auto::mod_load($argv[0]); # Check if we were successful or not.