diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-08-30 16:46:21 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-08-30 16:46:21 +0000 |
commit | 928fcf801f53d44d8b31b4285052a067340ab4ff (patch) | |
tree | 91f8b62b56467d63b1e6a4f49cecab63971dd43f /src/player.cpp | |
parent | c8c4fd4850b543215faf4de83cc0f93c17b5a038 (diff) | |
download | mana-client-928fcf801f53d44d8b31b4285052a067340ab4ff.tar.gz mana-client-928fcf801f53d44d8b31b4285052a067340ab4ff.tar.bz2 mana-client-928fcf801f53d44d8b31b4285052a067340ab4ff.tar.xz mana-client-928fcf801f53d44d8b31b4285052a067340ab4ff.zip |
Merged equipment database with items database and got rid of the unused item
art attribute. Removed the now unnecessary multiplication of weapon IDs with
10000. Added a fallback item icon and used it for unknown items or when an item
image fails to load.
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/player.cpp b/src/player.cpp index de3bc760..fbac7fa9 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -27,7 +27,8 @@ #include "game.h" #include "graphics.h" -#include "resources/equipmentdb.h" +#include "resources/itemdb.h" +#include "resources/iteminfo.h" #include "utils/tostring.h" @@ -104,13 +105,13 @@ Player::setSex(Uint8 sex) mSprites[BASE_SPRITE] = newBaseSprite; // Reload equipment - for (int i=1; i<VECTOREND_SPRITE ; i++) + for (int i = 1; i < VECTOREND_SPRITE; i++) { if (i != HAIR_SPRITE && mEquipmentSpriteIDs.at(i) != 0) { AnimatedSprite *newEqSprite = new AnimatedSprite( - "graphics/sprites/" + EquipmentDB::get( - mEquipmentSpriteIDs.at(i))->getSprite(sex)); + "graphics/sprites/" + ItemDB::get( + mEquipmentSpriteIDs.at(i)).getSprite(sex)); delete mSprites[i]; mSprites[i] = newEqSprite; } @@ -174,11 +175,11 @@ Player::setVisibleEquipment(Uint8 slot, int id) if (mSex == 0) { equipmentSprite = new AnimatedSprite( - "graphics/sprites/" + EquipmentDB::get(id)->getSprite(0)); + "graphics/sprites/" + ItemDB::get(id).getSprite(0)); } else { equipmentSprite = new AnimatedSprite( - "graphics/sprites/" + EquipmentDB::get(id)->getSprite(1)); + "graphics/sprites/" + ItemDB::get(id).getSprite(1)); } equipmentSprite->setDirection(getSpriteDirection()); @@ -188,7 +189,7 @@ Player::setVisibleEquipment(Uint8 slot, int id) if (slot == WEAPON_SPRITE) { - mEquippedWeapon = EquipmentDB::get(id); + mEquippedWeapon = &ItemDB::get(id); } setAction(mAction); |