From a7dbfd97819d87eec46dca59399a786ac2fa1fa8 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Thu, 30 Mar 2023 09:45:36 -0700 Subject: [PATCH] minor cleanup in ItemCreator --- src/ItemCreator.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ItemCreator.cc b/src/ItemCreator.cc index 183bd704..97f91257 100644 --- a/src/ItemCreator.cc +++ b/src/ItemCreator.cc @@ -423,8 +423,8 @@ void ItemCreator::clear_tool_item_if_invalid(ItemData& item) { void ItemCreator::clear_item_if_restricted(ItemData& item) const { if (this->item_parameter_table->is_item_rare(item) && !this->are_rare_drops_allowed()) { - item.clear(); this->log.info("Restricted: item is rare, but rares not allowed"); + item.clear(); return; } @@ -450,11 +450,11 @@ void ItemCreator::clear_item_if_restricted(ItemData& item) const { case Restrictions::WeaponAndArmorMode::ONLY_PICKING: break; case Restrictions::WeaponAndArmorMode::NO_RARE: - if (!this->item_parameter_table->is_item_rare(item)) { + if (this->item_parameter_table->is_item_rare(item)) { this->log.info("Restricted: rare items not allowed"); - break; + item.clear(); } - [[fallthrough]]; + break; case Restrictions::WeaponAndArmorMode::ALL_OFF: this->log.info("Restricted: weapons and armors not allowed"); item.clear(); @@ -512,8 +512,6 @@ void ItemCreator::clear_item_if_restricted(ItemData& item) const { - - void ItemCreator::generate_common_item_variances( uint32_t norm_area, ItemData& item) { switch (item.data1[0]) { @@ -681,7 +679,6 @@ void ItemCreator::generate_common_weapon_variances( this->generate_common_weapon_special(item, area_norm); this->set_item_unidentified_flag_if_challenge(item); } - return; } void ItemCreator::generate_common_weapon_grind(