summaryrefslogtreecommitdiff
path: root/src/resources/spritedef.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-12-23 02:16:53 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-12-23 02:16:53 +0000
commitd83e795dc3c8a07238939ee0b581cbfd1807cf1b (patch)
tree5ce6c06c867c61fffe934a67b2636c6c7a9e8b79 /src/resources/spritedef.cpp
parent8d3e43a7510dd7367c3bb62aae6841836f727493 (diff)
downloadMana-d83e795dc3c8a07238939ee0b581cbfd1807cf1b.tar.gz
Mana-d83e795dc3c8a07238939ee0b581cbfd1807cf1b.tar.bz2
Mana-d83e795dc3c8a07238939ee0b581cbfd1807cf1b.tar.xz
Mana-d83e795dc3c8a07238939ee0b581cbfd1807cf1b.zip
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.
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r--src/resources/spritedef.cpp5
1 files changed, 4 insertions, 1 deletions
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);