From 84e67980ecad7f8339b6c62b8e4908fa1a51c6f8 Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Thu, 4 Jul 2024 20:42:41 +0200 Subject: [PATCH] Added an option to prevent stealing --- src/EventListener.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/EventListener.cpp b/src/EventListener.cpp index a985125..a03759a 100644 --- a/src/EventListener.cpp +++ b/src/EventListener.cpp @@ -16,6 +16,7 @@ inline std::map g_settings{ { "bPickupFlora", true }, { "bPickupIngredients", true }, { "bPickupSoulGems", true }, + { "bAllowStealing", true }, }; auto EventListener::GetSingleton() -> EventListener* @@ -84,6 +85,7 @@ auto EventListener::ProcessEvent( } std::unordered_set refQueue; + bool bAllowStealing = std::any_cast(g_settings["bAllowStealing"]); TES->ForEachReferenceInRange(initRef, static_cast(std::any_cast(g_settings["iRadius"])), [&](RE::TESObjectREFR* a_ref) { if (!a_ref) { @@ -100,6 +102,10 @@ auto EventListener::ProcessEvent( return RE::BSContainer::ForEachResult::kContinue; } + if (!bAllowStealing && a_ref->IsCrimeToActivate()) { + return RE::BSContainer::ForEachResult::kContinue; + } + bool bAdd = false; if (initBase == refBase) {