Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
509 stars 128 forks source link

pathCache search keeps searching even after file is found #247

Open LiEnby opened 2 years ago

LiEnby commented 2 years ago

https://github.com/Ancurio/mkxp/blob/380b676777b101a7d6648a8e6b9a226a8984bbc0/src/filesystem.cpp#L666-L674

if you see this for loop, it will always loop until the end of the list is found, ideally you'd stop once PHYSFS_ENUM_STOP was returned, (file was found)

for (size_t i = 0; i < fileList.size(); ++i)
            if(openReadEnumCB(data, dir, fileList[i].c_str()) == PHYSFS_ENUM_STOP)
                break;

this is likely why #246 has gone unnoticed.