diff options
Diffstat (limited to 'src/monster.cpp')
-rw-r--r-- | src/monster.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/monster.cpp b/src/monster.cpp index 40b36849..779b4f56 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -35,8 +35,16 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map): Being(id, job, map) { - mSprites[BASE_SPRITE] = AnimatedSprite::load( - "graphics/sprites/" + MonsterDB::get(job - 1002).getSprite()); + std::string filename = MonsterDB::get(job - 1002).getSprite(); + if (filename != "") + { + mSprites[BASE_SPRITE] = AnimatedSprite::load( + "graphics/sprites/" + filename); + } + else + { + mSprites[BASE_SPRITE] = AnimatedSprite::load("graphics/sprites/error.xml"); + } } void |