summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-07-01 23:29:39 +0300
committerAndrei Karas <akaras@inbox.ru>2013-07-01 23:31:38 +0300
commitf4ad6ecb3cb3a003778357565d7faf5f10822c2c (patch)
tree9468184420270e3c12f3962ae25bbf252d87a514 /src/resources
parent4c8586dc8fde6428468fa148ff8c478cf93caeab (diff)
downloadplus-f4ad6ecb3cb3a003778357565d7faf5f10822c2c.tar.gz
plus-f4ad6ecb3cb3a003778357565d7faf5f10822c2c.tar.bz2
plus-f4ad6ecb3cb3a003778357565d7faf5f10822c2c.tar.xz
plus-f4ad6ecb3cb3a003778357565d7faf5f10822c2c.zip
fix up/down direction in sprites drawbefore/drawafter for legacy servers.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/iteminfo.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 9ca3f4f1e..4b85beb64 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -239,14 +239,33 @@ SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(const int direction) const
void ItemInfo::setSpriteOrder(int *const ptr, const int direction,
const int n, const int def) const
{
- if (direction == -1)
+ switch (direction)
{
- for (int f = 0; f < 10; f ++)
+ case -1:
{
- if (ptr[f] == def)
- ptr[f] = n;
+ for (int f = 0; f < 10; f ++)
+ {
+ if (ptr[f] == def)
+ ptr[f] = n;
+ }
+ return;
}
- return;
+ case -2:
+ {
+ ptr[DIRECTION_DOWN] = n;
+ ptr[DIRECTION_DOWNLEFT] = n;
+ ptr[DIRECTION_DOWNRIGHT] = n;
+ return;
+ }
+ case -3:
+ {
+ ptr[DIRECTION_UP] = n;
+ ptr[DIRECTION_UPLEFT] = n;
+ ptr[DIRECTION_UPRIGHT] = n;
+ return;
+ }
+ default:
+ break;
}
if (direction < 0 || direction >= 9)
return;