Skip to content

Commit

Permalink
refs #1150 cache player items v4, fixed containers save, tested
Browse files Browse the repository at this point in the history
  • Loading branch information
gesior committed Sep 8, 2019
1 parent c239da4 commit ed06e27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/container.cpp
Expand Up @@ -76,6 +76,16 @@ Item* Container::clone() const
return clone;
}

Item* Container::cloneWithoutDecay() const
{
Container* clone = static_cast<Container*>(Item::cloneWithoutDecay());
for (Item* item : itemlist) {
clone->addItem(item->cloneWithoutDecay());
}
clone->totalWeight = totalWeight;
return clone;
}

Container* Container::getParentContainer()
{
Thing* thing = getParent();
Expand Down
1 change: 1 addition & 0 deletions src/container.h
Expand Up @@ -59,6 +59,7 @@ class Container : public Item, public Cylinder
Container& operator=(const Container&) = delete;

Item* clone() const override final;
Item* cloneWithoutDecay() const override final;

Container* getContainer() override final {
return this;
Expand Down

0 comments on commit ed06e27

Please sign in to comment.