1

Pickup ingredients when activating flora

This commit is contained in:
Eddoursul 2024-07-04 14:39:14 +02:00
parent bebafe8a80
commit d22595f6d2

View File

@ -110,13 +110,17 @@ auto EventListener::ProcessEvent(
bAdd = a_refBase->Is(RE::FormType::Misc) && a_refBase->As<RE::BGSKeywordForm>()->HasKeyword(keywordIngot); bAdd = a_refBase->Is(RE::FormType::Misc) && a_refBase->As<RE::BGSKeywordForm>()->HasKeyword(keywordIngot);
} else if (bIsFlora || bIsTree || bIsIngredient) { } else if (bIsFlora || bIsTree || bIsIngredient) {
const auto floraBase = a_refBase->As<RE::TESFlora>(); if (a_refBase == produceItem) {
if (floraBase && (floraBase->produceItem == produceItem || floraBase->produceItem == baseObj)) {
bAdd = true; bAdd = true;
} else { } else {
const auto treeBase = a_refBase->As<RE::TESObjectTREE>(); const auto floraBase = a_refBase->As<RE::TESFlora>();
if (treeBase && (treeBase->produceItem == produceItem || treeBase->produceItem == baseObj)) { if (floraBase && (floraBase->produceItem == produceItem || floraBase->produceItem == baseObj)) {
bAdd = true; bAdd = true;
} else {
const auto treeBase = a_refBase->As<RE::TESObjectTREE>();
if (treeBase && (treeBase->produceItem == produceItem || treeBase->produceItem == baseObj)) {
bAdd = true;
}
} }
} }
} }