From 46696c84bad31e35e003b5c09998503119b128eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 28 Aug 2012 13:25:35 +0300 Subject: Add to replace/reorder sprites pseudo direction "died" It allow change sprites in dead players. --- src/resources/iteminfo.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/resources/iteminfo.cpp') 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 *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]; } -- cgit v1.2.3-70-g09d2