From 2bd399fd00d87683e37b41bfc1a25772c6cde71f Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 24 Jun 2023 23:38:27 +1000 Subject: Armor optimizations --- source/game/StarItem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/game/StarItem.cpp') 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(*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; +} + } -- cgit v1.2.3