From db278c390d466cca5f3e970f7ad81bb7dc31b48d Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Mon, 8 Mar 2004 15:12:16 +0000 Subject: [PATCH] log_amx: remove .amx from plugin names --- amxmodx/amxmod.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/amxmodx/amxmod.cpp b/amxmodx/amxmod.cpp index e019b00a..1ec12108 100755 --- a/amxmodx/amxmod.cpp +++ b/amxmodx/amxmod.cpp @@ -2056,7 +2056,13 @@ static cell AMX_NATIVE_CALL log_amx(AMX *amx, cell *params) { CPluginMngr::CPlugin *plugin = g_plugins.findPluginFast(amx); int len; - UTIL_Log("[%s] %s", plugin->getName(), format_amxstring(amx, params, 1, len)); + // remove extension (.amx for example) + std::string name = plugin->getName(); + size_t pos = name.rfind('.'); + if (pos != std::string::npos) + name.erase(pos); + + UTIL_Log("[%s] %s", name.c_str(), format_amxstring(amx, params, 1, len)); return 0; }