Fix ArmorWearer setters

silly me
This commit is contained in:
Kae 2023-06-25 14:00:41 +10:00
parent 25b021c0cb
commit f7d5ff8deb
2 changed files with 9 additions and 9 deletions

View File

@ -168,56 +168,56 @@ List<PersistentStatusEffect> ArmorWearer::statusEffects() const {
} }
void ArmorWearer::setHeadItem(HeadArmorPtr headItem) { void ArmorWearer::setHeadItem(HeadArmorPtr headItem) {
if (!Item::itemsEqual(m_headItem, headItem)) if (Item::itemsEqual(m_headItem, headItem))
return; return;
m_headItem = headItem; m_headItem = headItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setHeadCosmeticItem(HeadArmorPtr headCosmeticItem) { void ArmorWearer::setHeadCosmeticItem(HeadArmorPtr headCosmeticItem) {
if (!Item::itemsEqual(m_headCosmeticItem, headCosmeticItem)) if (Item::itemsEqual(m_headCosmeticItem, headCosmeticItem))
return; return;
m_headCosmeticItem = headCosmeticItem; m_headCosmeticItem = headCosmeticItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setChestCosmeticItem(ChestArmorPtr chestCosmeticItem) { void ArmorWearer::setChestCosmeticItem(ChestArmorPtr chestCosmeticItem) {
if (!Item::itemsEqual(m_chestCosmeticItem, chestCosmeticItem)) if (Item::itemsEqual(m_chestCosmeticItem, chestCosmeticItem))
return; return;
m_chestCosmeticItem = chestCosmeticItem; m_chestCosmeticItem = chestCosmeticItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setChestItem(ChestArmorPtr chestItem) { void ArmorWearer::setChestItem(ChestArmorPtr chestItem) {
if (!Item::itemsEqual(m_chestItem, chestItem)) if (Item::itemsEqual(m_chestItem, chestItem))
return; return;
m_chestItem = chestItem; m_chestItem = chestItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setLegsItem(LegsArmorPtr legsItem) { void ArmorWearer::setLegsItem(LegsArmorPtr legsItem) {
if (!Item::itemsEqual(m_legsItem, legsItem)) if (Item::itemsEqual(m_legsItem, legsItem))
return; return;
m_legsItem = legsItem; m_legsItem = legsItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setLegsCosmeticItem(LegsArmorPtr legsCosmeticItem) { void ArmorWearer::setLegsCosmeticItem(LegsArmorPtr legsCosmeticItem) {
if (!Item::itemsEqual(m_legsCosmeticItem, legsCosmeticItem)) if (Item::itemsEqual(m_legsCosmeticItem, legsCosmeticItem))
return; return;
m_legsCosmeticItem = legsCosmeticItem; m_legsCosmeticItem = legsCosmeticItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setBackItem(BackArmorPtr backItem) { void ArmorWearer::setBackItem(BackArmorPtr backItem) {
if (!Item::itemsEqual(m_backItem, backItem)) if (Item::itemsEqual(m_backItem, backItem))
return; return;
m_backItem = backItem; m_backItem = backItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;
} }
void ArmorWearer::setBackCosmeticItem(BackArmorPtr backCosmeticItem) { void ArmorWearer::setBackCosmeticItem(BackArmorPtr backCosmeticItem) {
if (!Item::itemsEqual(m_backCosmeticItem, backCosmeticItem)) if (Item::itemsEqual(m_backCosmeticItem, backCosmeticItem))
return; return;
m_backCosmeticItem = backCosmeticItem; m_backCosmeticItem = backCosmeticItem;
m_needsHumanoidSync = true; m_needsHumanoidSync = true;

View File

@ -291,7 +291,7 @@ bool Item::itemsEqual(ItemConstPtr const& a, ItemConstPtr const& b) {
if (a && b) // Both aren't null, compare if (a && b) // Both aren't null, compare
return a->stackableWith(b); return a->stackableWith(b);
else // One is null, so not equal else // One is null, so not equal
return true; return false;
} }
} }