@@ -167,36 +167,13 @@ void CCommandFuncs::Clear(const char* szParameters)
167167
168168void CCommandFuncs::Load (const char * szParameters)
169169{
170- if (!szParameters)
171- {
172- CCore::GetSingleton ().GetConsole ()->Printf (" * Syntax: load <mod-name> [<arguments>]" );
173- return ;
174- }
175-
176- // Copy the buffer
177- char * szTemp = new char [strlen (szParameters) + 1 ];
178- strcpy (szTemp, szParameters);
179-
180- // Split it up into mod name and the arguments
181- char * szModName = strtok (szTemp, " " );
182- char * szArguments = strtok (NULL , " \0 " );
183-
184- if (szModName)
185- {
186- // Load the mod with the given arguments
187- CModManager::GetSingleton ().RequestLoad (szModName, szArguments);
188- }
189- else
190- CCore::GetSingleton ().GetConsole ()->Printf (" * Syntax: load <mod-name> [<arguments>]" );
191-
192- // Free the temp buffer
193- delete[] szTemp;
170+ CModManager::GetSingleton ().RequestLoad (szParameters);
194171}
195172
196173void CCommandFuncs::Unload (const char * szParameters)
197174{
198175 // Any mod loaded?
199- if (CModManager::GetSingleton ().GetCurrentMod ())
176+ if (CModManager::GetSingleton ().IsLoaded ())
200177 {
201178 // Unload it
202179 CModManager::GetSingleton ().RequestUnload ();
@@ -264,7 +241,7 @@ void CCommandFuncs::Connect(const char* szParameters)
264241 CModManager::GetSingleton ().Unload ();
265242
266243 // Only connect if there is no mod loaded
267- if (!CModManager::GetSingleton ().GetCurrentMod ())
244+ if (!CModManager::GetSingleton ().IsLoaded ())
268245 {
269246 // Start the connect
270247 if (CCore::GetSingleton ().GetConnectManager ()->Connect (szHost, usPort, strNick.c_str (), szPass))
@@ -284,7 +261,7 @@ void CCommandFuncs::Connect(const char* szParameters)
284261
285262void CCommandFuncs::ReloadNews (const char * szParameters)
286263{
287- if (CModManager::GetSingleton ().GetCurrentMod ())
264+ if (CModManager::GetSingleton ().IsLoaded ())
288265 {
289266 CCore::GetSingleton ().GetConsole ()->Print (" reloadnews: can't do this whilst connected to server" );
290267 return ;
@@ -309,7 +286,7 @@ void CCommandFuncs::Reconnect(const char* szParameters)
309286 CModManager::GetSingleton ().Unload ();
310287
311288 // Any mod loaded?
312- if (!CModManager::GetSingleton ().GetCurrentMod ())
289+ if (!CModManager::GetSingleton ().IsLoaded ())
313290 {
314291 // Verify and convert the port number
315292 if (uiPort <= 0 || uiPort > 0xFFFF )
0 commit comments