diff options
-rw-r--r-- | src/engine.cpp | 7 | ||||
-rw-r--r-- | src/gui/equipment.cpp | 4 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 7 |
3 files changed, 8 insertions, 10 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index d1feacf2..8a421041 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -341,10 +341,9 @@ void Engine::draw() int sy = y - camera_y; int absx = sx * 32 - offset_x; int absy = sy * 32 - offset_y; - if (floorItem->id >= 501 && floorItem->id <= 1202) { - itemset->spriteset[floorItem->id - 501]->draw(screen, - absx, - absy); + if (itemDb.getImage(floorItem->id) > 0) { + itemset->spriteset[itemDb.getImage(floorItem->id) - 1]->draw(screen, + absx, absy); } floorItemIterator++; diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp index a29c137f..1c559263 100644 --- a/src/gui/equipment.cpp +++ b/src/gui/equipment.cpp @@ -58,8 +58,8 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) for (int i = 0; i < 8; i++) { if (equipments[i].id > 0) { - itemset->spriteset[equipments[i].id - 501]->draw(screen, - x + 22, y + 24 * i + 20); + itemset->spriteset[itemDb.getImage(equipments[i].id) - 1]->draw( + screen, x + 22, y + 24 * i + 20); } graphics->setColor(gcn::Color(0, 0, 0)); graphics->drawRectangle(gcn::Rectangle(22, 24 * i + 20, 20, 20)); diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 51d093b7..61dad053 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -75,10 +75,9 @@ void ItemContainer::draw(gcn::Graphics* graphics) int itemY = (((i - 2) * 24) / (getWidth() - 24)) * 24; itemX -= itemX % 24; if (items[i].quantity > 0) { - if (items[i].id >= 501 && items[i].id <= 1202) { - itemset->spriteset[items[i].id - 501]->draw(screen, - x + itemX, - y + itemY); + if (itemDb.getImage(items[i].id) > 0) { + itemset->spriteset[itemDb.getImage(items[i].id) - 1]->draw( + screen, x + itemX, y + itemY); } std::stringstream ss; |