diff --git a/source/src/texture.cpp b/source/src/texture.cpp index 3e09b6d7..ae7562fe 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -225,13 +225,12 @@ void loadnotexture(char *c) { const char *defnotex = "packages/misc/notexture.jpg"; notexture = textureload(defnotex); // reset to default - if(strcmp(c,"")) + if(c[0]) { - Texture *missingtex; s_sprintfd(p)("packages/textures/%s", c); - missingtex = textureload(p); - if(missingtex==notexture) { conoutf("could not load alternative texture '%s'.", p); s_sprintf(p)(defnotex); } - notexture = textureload(p); + Texture *missingtex = textureload(p); + if(missingtex==notexture) { conoutf("could not load alternative texture '%s'.", p); s_strcpy(p, defnotex); } + else notexture = missingtex; conoutf("using '%s' as alternative texture", p); } }