From 2136d196ef0e1dbb6d085c163443d83ec0766610 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 10 Feb 2005 14:39:16 +0000 Subject: Fixed PlayerBox to cope with no hair as well, and fixed using Makefile.cvs a bit, to generate the configure. --- src/gui/playerbox.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gui/playerbox.cpp') diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp index 926b8b08..1abeaaa2 100644 --- a/src/gui/playerbox.cpp +++ b/src/gui/playerbox.cpp @@ -61,9 +61,13 @@ void PlayerBox::draw(gcn::Graphics *graphics) playerset->spriteset[0]->draw(screen, x - 25, y - 25); // Draw his hair - int hf = hairColor + 40 * (hairStyle); - if (hf >= 0 && hf < (int)hairset->spriteset.size()) { - hairset->spriteset[hf]->draw(screen, x + 37, y + 5); + if (hairColor >= 0 && hairStyle >= 0 && + hairColor < 10 && hairStyle < 4) + { + int hf = hairColor + 40 * (hairStyle); + if (hf >= 0 && hf < (int)hairset->spriteset.size()) { + hairset->spriteset[hf]->draw(screen, x + 37, y + 5); + } } } } -- cgit v1.2.3-70-g09d2