summaryrefslogtreecommitdiff
path: root/Creatures.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Creatures.cpp')
-rw-r--r--Creatures.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/Creatures.cpp b/Creatures.cpp
index 38cef17..bface8c 100644
--- a/Creatures.cpp
+++ b/Creatures.cpp
@@ -277,11 +277,18 @@ void DrawCreature(int drawx, int drawy, t_unit* creature, Block * b){
}
c_sprite * sprite = GetCreatureSpriteMap( creature );
+ if(sprite)
+ sprite->draw_world(creature->x,creature->y, creature->z, b);
+ else
+ {
+ df::creature_raw *raw = df::global::world->raws.creatures.all[creature->race];
+ int spritenum = raw->creature_tile;
+ spritenum += (spritenum/16)*4;
+ DrawSpriteFromSheet(spritenum,IMGLetterSheet,config.colors.getDfColor(raw->color[0],raw->color[2]),drawx,drawy,b);
+ }
unsigned int offsety = config.show_creature_names ? al_get_font_line_height(font) : 0;
-
- sprite->draw_world(creature->x,creature->y, creature->z, b);
-
+
if(statusIcons.size())
{
for(int i = 0; i < statusIcons.size(); i++)
@@ -551,12 +558,9 @@ CreatureConfiguration *GetCreatureConfig( t_unit* c ){
c_sprite* GetCreatureSpriteMap( t_unit* c )
{
- static c_sprite * defaultSprite = new c_sprite;
- defaultSprite->reset();
- defaultSprite->set_defaultsheet(IMGCreatureSheet);
CreatureConfiguration *testConfig = GetCreatureConfig( c );
if (testConfig == NULL)
- return defaultSprite;
+ return NULL;
testConfig->sprite.set_defaultsheet(IMGCreatureSheet);
return &(testConfig->sprite);
}