Don't try to create textures for empty names.

It's not designed to work with empty file names, because the "existFile" function in irrlicht returns true for directories, our file manager doesn't check that it's a directory and generally strange things happen.

This solves a problem with luna track that doesn't have a screenshot and possibly with some broken add-ons, so that valgrind doesn't complain anymore.

Benau, feel free to revert it if you have better solution.
This commit is contained in:
Deve 2017-09-03 00:04:29 +02:00
parent 6710fc2a5c
commit 1123ceeceb

View File

@ -147,6 +147,12 @@ video::ITexture* STKTexManager::getTexture(const std::string& path,
TexConfig* tc, bool no_upload,
bool create_if_unfound)
{
if (path.empty())
{
Log::error("STKTexManager", "Texture name is empty.");
return NULL;
}
auto ret = m_all_textures.find(path);
if (!no_upload && ret != m_all_textures.end())
return ret->second;