From 3242aa80fbee19eb421ace68d1c3c69e4fc777e6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Aug 2015 18:35:06 +0300 Subject: Add packet SMSG_ITEM_VISIBLE2 0x0b18. Change net version to 10. --- src/flooritem.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/flooritem.cpp') 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); -- cgit v1.2.3-70-g09d2