From fce52698aa5eb3a681a63cc1c2e3e35d517c4eba Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Fri, 8 Aug 2008 08:03:36 +0000 Subject: [PATCH] loadnotexture cleanup git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2296 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/texture.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); } }