1

Fixed dropped arrows pickup

This commit is contained in:
Eddoursul 2024-07-04 14:34:07 +02:00
parent 28c4d6fd2e
commit bebafe8a80
2 changed files with 5 additions and 4 deletions

View File

@ -48,7 +48,7 @@ auto EventListener::ProcessEvent(
bool bIsHide = keywordForm && keywordForm->HasKeyword(keywordHide); bool bIsHide = keywordForm && keywordForm->HasKeyword(keywordHide);
bool bIsIngot = keywordForm && keywordForm->HasKeyword(keywordIngot); bool bIsIngot = keywordForm && keywordForm->HasKeyword(keywordIngot);
bool bIsAmmo = (baseObj->IsAmmo() || baseObj->Is(RE::FormType::ProjectileArrow)) && baseObj->GetPlayable(); bool bIsAmmo = (baseObj->IsAmmo() || baseObj->Is(RE::FormType::Projectile)) && baseObj->GetPlayable();
bool bIsFlora = !bIsCoinPouch && baseObj->Is(RE::FormType::Flora) && (produceItem = baseObj->As<RE::TESFlora>()->produceItem); bool bIsFlora = !bIsCoinPouch && baseObj->Is(RE::FormType::Flora) && (produceItem = baseObj->As<RE::TESFlora>()->produceItem);
bool bIsTree = baseObj->Is(RE::FormType::Tree) && (produceItem = baseObj->As<RE::TESObjectTREE>()->produceItem); bool bIsTree = baseObj->Is(RE::FormType::Tree) && (produceItem = baseObj->As<RE::TESObjectTREE>()->produceItem);
@ -81,7 +81,7 @@ auto EventListener::ProcessEvent(
return RE::BSContainer::ForEachResult::kContinue; return RE::BSContainer::ForEachResult::kContinue;
} }
if (a_ref->IsDisabled() || (a_ref == baseRef) || IsTaken(a_ref) || a_ref->IsActivationBlocked() || !a_ref->Is3DLoaded()) { if (a_ref->IsDisabled() || IsTaken(a_ref) || a_ref->IsActivationBlocked() || !a_ref->Is3DLoaded()) {
return RE::BSContainer::ForEachResult::kContinue; return RE::BSContainer::ForEachResult::kContinue;
} }
@ -96,7 +96,7 @@ auto EventListener::ProcessEvent(
} }
} else if (bIsAmmo) { } else if (bIsAmmo) {
if ((a_refBase->IsAmmo() || a_refBase->Is(RE::FormType::ProjectileArrow)) && a_refBase->GetPlayable()) { if ((a_refBase->IsAmmo() || a_refBase->Is(RE::FormType::Projectile)) && a_refBase->GetPlayable()) {
bAdd = true; bAdd = true;
} }
@ -139,7 +139,7 @@ auto EventListener::ProcessEvent(
std::this_thread::sleep_for(std::chrono::milliseconds(100)); std::this_thread::sleep_for(std::chrono::milliseconds(100));
SKSE::GetTaskInterface()->AddTask([&item]() { SKSE::GetTaskInterface()->AddTask([&item]() {
if (item && item->formID) { if (item && item->formID) {
item->ActivateRef(RE::PlayerCharacter::GetSingleton(), 0, nullptr, 1, false); item->ActivateRef(RE::PlayerCharacter::GetSingleton(), 0, nullptr, item->extraList.GetCount(), false);
} }
}); });
} }

View File

@ -27,6 +27,7 @@ public:
RE::FormType::Tree, RE::FormType::Tree,
RE::FormType::Ammo, RE::FormType::Ammo,
RE::FormType::Ingredient, RE::FormType::Ingredient,
RE::FormType::Projectile,
}; };
static RE::BGSKeyword* keywordGem; static RE::BGSKeyword* keywordGem;