diff --git a/release/plugins/MultiSend.dll b/release/plugins/MultiSend.dll index cb241c2..80eb949 100644 Binary files a/release/plugins/MultiSend.dll and b/release/plugins/MultiSend.dll differ diff --git a/src/MultiSend/Commands.cpp b/src/MultiSend/Commands.cpp index 395edb7..3a925f7 100644 --- a/src/MultiSend/Commands.cpp +++ b/src/MultiSend/Commands.cpp @@ -4,27 +4,31 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) { std::string arg; const char* com = command + GetArg(command, &arg); - if ((_stricmp(arg.c_str(), "/ms")) + if ((_strnicmp(command, "/ms", 3)) && (_stricmp(arg.c_str(), "/multisend"))) { return false; } if (strlen(com) < 2) return true; - com++; - com += GetArg(com, &arg); - - + if ((_stricmp(arg.c_str(), "/ms") == 0) + || (_stricmp(arg.c_str(), "/multisend")) == 0) + { + com++; + com += GetArg(com, &arg); + } + if ((_stricmp(arg.c_str(), "send") == 0) - || (_stricmp(command, "/mss") == 0)) + || (_stricmp(arg.c_str(), "/mss") == 0)) { + if (strlen(com) < 2) return true; SendCommand(0xFFFF0000, com + 1); return true; } - if ((_stricmp(arg.c_str(), "sendto") == 0) - || (_stricmp(command, "/mst") == 0)) + else if ((_stricmp(arg.c_str(), "sendto") == 0) + || (_stricmp(arg.c_str(), "/mst") == 0)) { if (strlen(com) < 2) { @@ -52,10 +56,11 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) InterlockedExchange(&(MMF_Pointer->Name.ProcessID), 0); m_AshitaCore->GetChatManager()->Write("MultiSend: Character not found."); + return true; } - if ((_stricmp(arg.c_str(), "sendgroup") == 0) - || (_stricmp(command, "/msg") == 0)) + else if ((_stricmp(arg.c_str(), "sendgroup") == 0) + || (_stricmp(arg.c_str(), "/msg") == 0)) { if (strlen(com) < 3) { @@ -78,7 +83,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) return true; } - if (_stricmp(arg.c_str(), "followme") == 0) + else if (_stricmp(arg.c_str(), "followme") == 0) { if (strlen(com) < 2) return true; com++; @@ -120,7 +125,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) return true; } - if (_stricmp(arg.c_str(), "follow") == 0) + else if (_stricmp(arg.c_str(), "follow") == 0) { if (strlen(com) < 2) return true; com++; @@ -146,7 +151,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) return true; } - if (_stricmp(arg.c_str(), "ignoreself") == 0) + else if (_stricmp(arg.c_str(), "ignoreself") == 0) { if (strlen(com) < 2) return true; com++; @@ -171,7 +176,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) return true; } - if (_stricmp(arg.c_str(), "debug") == 0) + else if (_stricmp(arg.c_str(), "debug") == 0) { if (strlen(com) < 2) return true; com++; @@ -197,13 +202,13 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) return true; } - if (_stricmp(arg.c_str(), "reload") == 0) + else if (_stricmp(arg.c_str(), "reload") == 0) { LoadGroups(); return true; } - if (_stricmp(arg.c_str(), "help") == 0) + else if (_stricmp(arg.c_str(), "help") == 0) { m_AshitaCore->GetChatManager()->Write("Multisend Command Listing"); m_AshitaCore->GetChatManager()->Write("/ms send [command] - Sends [command] to all characters with multisend loaded."); @@ -216,8 +221,8 @@ bool MultiSend::HandleCommand(const char* command, int32_t type) m_AshitaCore->GetChatManager()->Write("/ms debug on/off - When enabled, debug prints will be visible."); return true; } - - return true; + + return (_strnicmp(command, "/ms ", 4) == 0); } uint32_t MultiSend::GetArg(const char* text, std::string* buffer) diff --git a/src/MultiSend/Main.cpp b/src/MultiSend/Main.cpp index fbcc238..04af330 100644 --- a/src/MultiSend/Main.cpp +++ b/src/MultiSend/Main.cpp @@ -116,7 +116,7 @@ __declspec(dllexport) void __stdcall CreatePluginInfo(plugininfo_t* lpBuffer) strcpy_s(g_PluginInfo->Author, sizeof(g_PluginInfo->Author), "Thorny"); g_PluginInfo->InterfaceVersion = ASHITA_INTERFACE_VERSION; - g_PluginInfo->PluginVersion = 1.02f; + g_PluginInfo->PluginVersion = 1.03f; g_PluginInfo->Priority = 0; }