diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-28 13:25:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-29 00:49:52 +0300 |
commit | 46696c84bad31e35e003b5c09998503119b128eb (patch) | |
tree | 7449b98a62fa7ff520d995b27511878d2605c7d4 /src/resources/iteminfo.cpp | |
parent | c79403e1341ac533df1771b866d1f5cee15e12b5 (diff) | |
download | plus-46696c84bad31e35e003b5c09998503119b128eb.tar.gz plus-46696c84bad31e35e003b5c09998503119b128eb.tar.bz2 plus-46696c84bad31e35e003b5c09998503119b128eb.tar.xz plus-46696c84bad31e35e003b5c09998503119b128eb.zip |
Add to replace/reorder sprites pseudo direction "died"
It allow change sprites in dead players.
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r-- | src/resources/iteminfo.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 57ccfb2e2..ed3e95e4e 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -84,7 +84,7 @@ ItemInfo::ItemInfo() : mHitEffectId(0), mCriticalHitEffectId(0) { - for (int f = 0; f < 9; f ++) + for (int f = 0; f < 10; f ++) { mSpriteToItemReplaceMap[f] = nullptr; mDrawBefore[f] = -1; @@ -97,7 +97,7 @@ ItemInfo::~ItemInfo() { delete_all(mSpriteToItemReplaceList); mSpriteToItemReplaceList.clear(); - for (int f = 0; f < 9; f ++) + for (int f = 0; f < 10; f ++) mSpriteToItemReplaceMap[f] = nullptr; } @@ -153,7 +153,7 @@ const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const std::map<int, int> *ItemInfo::addReplaceSprite(int sprite, int direction) { - if (direction < 0 || direction >= 9) + if (direction < 0 || direction >= 10) return nullptr; SpriteToItemMap *spMap = mSpriteToItemReplaceMap[direction]; @@ -239,7 +239,7 @@ const std::string ItemInfo::replaceColors(std::string str, SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(int direction) const { - if (direction < 0 || direction >= 9) + if (direction < 0 || direction >= 10) return nullptr; SpriteToItemMap *spMap = mSpriteToItemReplaceMap[direction]; @@ -258,7 +258,7 @@ void ItemInfo::setSpriteOrder(int *ptr, int direction, int n, int def) { if (direction == -1) { - for (int f = 0; f < 9; f ++) + for (int f = 0; f < 10; f ++) { if (ptr[f] == def) ptr[f] = n; @@ -302,21 +302,21 @@ void ItemInfo::setDrawPriority(int direction, int n) int ItemInfo::getDrawBefore(int direction) const { - if (direction < 0 || direction >= 9) + if (direction < 0 || direction >= 10) return -1; return mDrawBefore[direction]; } int ItemInfo::getDrawAfter(int direction) const { - if (direction < 0 || direction >= 9) + if (direction < 0 || direction >= 10) return -1; return mDrawAfter[direction]; } int ItemInfo::getDrawPriority(int direction) const { - if (direction < 0 || direction >= 9) + if (direction < 0 || direction >= 10) return 0; return mDrawPriority[direction]; } |