diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/playerbox.cpp | 10 | ||||
-rw-r--r-- | src/map.cpp | 4 |
2 files changed, 11 insertions, 3 deletions
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); + } } } } diff --git a/src/map.cpp b/src/map.cpp index d7ccb4d1..c4d9493b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -79,6 +79,7 @@ Tile::Tile(): { } + Location::Location(int x, int y, Tile *tile): x(x), y(y), tile(tile) { @@ -89,6 +90,7 @@ bool Location::operator< (const Location &loc) const return tile->Fcost < loc.tile->Fcost; } + Map::Map(): width(0), height(0), onClosedList(1), onOpenList(2) @@ -224,6 +226,8 @@ PATH_NODE *Map::findPath(int startX, int startY, int destX, int destY) Location curr = openList.top(); openList.pop(); curr.tile->whichList = onClosedList; + + } // Two new values to indicate wether a tile is on the open or closed list, |