From d83e795dc3c8a07238939ee0b581cbfd1807cf1b Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sun, 23 Dec 2007 02:16:53 +0000 Subject: Particle images are now reference-counted properly. Avoided attempts to load "data/graphics/" when a monster or equipment piece has no sprite. Error placeholder is now used when attempting to load a sprite definition file that doesn't exist. --- src/resources/spritedef.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/resources/spritedef.cpp') diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index de6f8d0b..ee823c3f 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -62,7 +62,10 @@ SpriteDef *SpriteDef::load(std::string const &animationFile, int variant) char *data = (char*) resman->loadFile (animationFile.substr(0, pos).c_str(), size); - if (!data) return NULL; + if (!data && animationFile != "graphics/sprites/error.xml") + { + return load("graphics/sprites/error.xml", 0); + } xmlDocPtr doc = xmlParseMemory(data, size); free(data); -- cgit v1.2.3-70-g09d2