From 862e8f821789014b6167f37976b80694d6d310e3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Apr 2017 04:44:53 +0300 Subject: Add item options into item and get it from server. --- src/resources/item/item.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/resources/item/item.cpp') diff --git a/src/resources/item/item.cpp b/src/resources/item/item.cpp index d738ca0e3..bc6614e52 100644 --- a/src/resources/item/item.cpp +++ b/src/resources/item/item.cpp @@ -30,10 +30,14 @@ #include "resources/iteminfo.h" +#include "resources/item/itemoptionslist.h" + #include "resources/loaders/imageloader.h" #include "net/serverfeatures.h" +#include "utils/delete2.h" + #include "debug.h" DragDrop dragDrop(nullptr, DragDropSource::Empty); @@ -56,6 +60,7 @@ Item::Item(const int id, mDescription(), mTags(), mCards(), + mOptions(nullptr), mRefine(refine), mInvIndex(0), mType(type), @@ -78,6 +83,7 @@ Item::~Item() mImage->decRef(); mImage = nullptr; } + delete2(mOptions); dragDrop.clearItem(this); } @@ -176,6 +182,11 @@ void Item::addCard(const int card) } } +void Item::setOptions(const ItemOptionsList *const options) +{ + mOptions = ItemOptionsList::copy(options); +} + void Item::updateColor() { if (serverFeatures && serverFeatures->haveItemColors()) -- cgit v1.2.3-70-g09d2