Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarItem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/game/StarItem.cpp')
-rw-r--r--source/game/StarItem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/game/StarItem.cpp b/source/game/StarItem.cpp
index 68590b5..e25870b 100644
--- a/source/game/StarItem.cpp
+++ b/source/game/StarItem.cpp
@@ -285,4 +285,13 @@ ItemPtr GenericItem::clone() const {
return make_shared<GenericItem>(*this);
}
+bool Item::itemsEqual(ItemConstPtr const& a, ItemConstPtr const& b) {
+ if (!a && !b) // Both are null
+ return true;
+ if (a && b) // Both aren't null, compare
+ return a->stackableWith(b);
+ else // One is null, so not equal
+ return true;
+}
+
}