diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-16 18:35:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 19:43:03 +0300 |
commit | 3242aa80fbee19eb421ace68d1c3c69e4fc777e6 (patch) | |
tree | 50cc1b2e47953c20059183889e667f673ba7e4c2 /src/flooritem.cpp | |
parent | d207e52ab770681f8bd584c06dd9aa03096b71f5 (diff) | |
download | plus-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.tar.gz plus-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.tar.bz2 plus-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.tar.xz plus-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.zip |
Add packet SMSG_ITEM_VISIBLE2 0x0b18.
Change net version to 10.
Diffstat (limited to 'src/flooritem.cpp')
-rw-r--r-- | src/flooritem.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/flooritem.cpp b/src/flooritem.cpp index 8cb59bd9d..b9d2f3cf3 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -23,6 +23,7 @@ #include "flooritem.h" #include "configuration.h" +#include "item.h" #include "render/graphics.h" @@ -48,14 +49,18 @@ FloorItem::FloorItem(const BeingId id, const int x, const int y, const int itemType, const int amount, + const int refine, const ItemColor color, - const Identified identified) : + const Identified identified, + const int *const cards) : ActorSprite(id), + mCards(), mItemId(itemId), mX(x), mY(y), mDropTime(cur_time), mAmount(amount), + mRefine(refine), mHeightPosDiff(0), mItemType(itemType), mPickupCount(0), @@ -65,6 +70,7 @@ FloorItem::FloorItem(const BeingId id, mShowMsg(true), mHighlight(config.getBoolValue("floorItemsHighlight")) { + setCards(cards, maxCards); } void FloorItem::postInit(Map *const map, int subX, int subY) @@ -103,6 +109,18 @@ void FloorItem::postInit(Map *const map, int subX, int subY) info.getDyeColorsString(mColor)); } +void FloorItem::setCards(const int *const cards, + const int size) +{ + if (size < 0 || !cards) + return; + int sz = size; + if (sz > maxCards) + sz = maxCards; + for (int f = 0; f < sz; f ++) + mCards[f] = cards[f]; +} + const ItemInfo &FloorItem::getInfo() const { return ItemDB::get(mItemId); |