Arreglado un bug a la hora de buscar por nombre los recursos

This commit is contained in:
2022-10-31 20:07:41 +01:00
parent a354104c8c
commit 83977ed22c
4 changed files with 33 additions and 13 deletions

View File

@@ -26,7 +26,10 @@ std::string Asset::get(std::string text)
{
for (auto f : fileList)
{
if (f.file.find(text) != std::string::npos)
const size_t lastIndex = f.file.find_last_of("/")+1;
const std:: string file = f.file.substr(lastIndex, std::string::npos);
if (file == text)
{
return f.file;
}