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

summaryrefslogtreecommitdiff
path: root/source/game/StarItem.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-24 23:38:27 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-24 23:38:27 +1000
commit2bd399fd00d87683e37b41bfc1a25772c6cde71f (patch)
treec720c2c428e17c408fb25b97e23b9fe4b9f2cd06 /source/game/StarItem.cpp
parent7eb010d4a1c6a90d5040b3ec2e7d189fb387b9b2 (diff)
Armor optimizations
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;
+}
+
}