diff --git a/AccuracyFix/AccuracyUtil.cpp b/AccuracyFix/AccuracyUtil.cpp index a6640cd..9bfbd8a 100644 --- a/AccuracyFix/AccuracyUtil.cpp +++ b/AccuracyFix/AccuracyUtil.cpp @@ -43,31 +43,16 @@ const char* CAccuracyUtil::GetPath() std::replace(this->m_Path.begin(), this->m_Path.end(), (char)(92), (char)(47)); - auto Position = this->m_Path.find_last_of((char)(47)); + this->m_Path.erase(this->m_Path.find_last_of((char)(47)), this->m_Path.length()); - if (Position != std::string::npos) - { - this->m_Path.erase(Position, this->m_Path.length()); - } - while (std::count(this->m_Path.begin(), this->m_Path.end(), (char)(47)) > 1) { - Position = this->m_Path.find_last_of((char)(47)); - - if (Position != std::string::npos) - { - this->m_Path.erase(Position, this->m_Path.length()); - } + this->m_Path.erase(this->m_Path.find_last_of((char)(47)), this->m_Path.length()); } } } } - if (!this->m_Path.empty()) - { - g_engfuncs.pfnServerPrint(this->m_Path.c_str()); - } - return this->m_Path.c_str(); }