From 579969a548e37bb631d3f79a5d420e577e022630 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 9 Feb 2005 17:41:31 +0000 Subject: Fixed the no hair problem. --- src/graphic/graphic.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/graphic/graphic.cpp') diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp index 99a7c319..65775c75 100644 --- a/src/graphic/graphic.cpp +++ b/src/graphic/graphic.cpp @@ -375,28 +375,29 @@ void Engine::draw() else if (being->job < 10) { // Draw a player being->text_x = sx * 32 + get_x_offset(being) - offset_x; being->text_y = sy * 32 + get_y_offset(being) - offset_y; - int hf = being->hair_color - 1 + 10 * (dir + 4 * - (being->hair_style - 1)); - - if (being->action == SIT || being->action == DEAD) being->frame = 0; - if (being->action == ATTACK) { - int pf = being->frame + being->action + 4 * being->weapon; - playerset->spriteset[4 * pf + dir]->draw(screen, - being->text_x - 64, being->text_y - 80); - hairset->spriteset[hf]->draw(screen, - being->text_x - 2 + 2 * hairtable[pf][dir][0], - being->text_y - 50 + 2 * hairtable[pf][dir][1]); + if (being->action == SIT || being->action == DEAD) { + being->frame = 0; } - else { - int pf = being->frame + being->action; - playerset->spriteset[4 * pf + dir]->draw(screen, - being->text_x - 64, being->text_y - 80); + int pf = being->frame + being->action; + + if (being->action == ATTACK) { + pf += 4 * being->weapon; + } + + playerset->spriteset[4 * pf + dir]->draw(screen, + being->text_x - 64, being->text_y - 80); + + if (being->hair_color <= 10) { + int hf = being->hair_color - 1 + 10 * (dir + 4 * + (being->hair_style - 1)); + hairset->spriteset[hf]->draw(screen, being->text_x - 2 + 2 * hairtable[pf][dir][0], being->text_y - 50 + 2 * hairtable[pf][dir][1]); } + if (being->emotion != 0) { emotionset->spriteset[being->emotion - 1]->draw(screen, sx * 32 - 5 + get_x_offset(being) - offset_x, -- cgit v1.2.3-70-g09d2