From 655d84bc4109cd6fd36546c64cb38cce44163cca Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Wed, 10 Aug 2022 21:04:23 +0200 Subject: [PATCH] Added GetPlayerFollowers() to EnderalSE.dll --- SKSE/Plugins/EnderalSE.dll | 4 ++-- scripts/enderalfunctions.pex | Bin 1107 -> 1162 bytes source/Enderal DLL/src/PapyrusFunctions.h | 17 +++++++++++++++++ source/scripts/enderalfunctions.psc | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/SKSE/Plugins/EnderalSE.dll b/SKSE/Plugins/EnderalSE.dll index 4239dfa3..f16eb2ea 100644 --- a/SKSE/Plugins/EnderalSE.dll +++ b/SKSE/Plugins/EnderalSE.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ca53b8bec9e51db776840ffbd043d637b1bc960c0c37621ab5fa07d1f590bde0 -size 643584 +oid sha256:c36e877366484af2b3631a38ffe19174963e8fa459ccdfb4a09613ef40ee689d +size 647168 diff --git a/scripts/enderalfunctions.pex b/scripts/enderalfunctions.pex index d590081d67a8fbd5e37ee19e17b7d8e1bde1ebd9..e4f711af740e72e5a698d2aac0aad52876e6d0dc 100644 GIT binary patch delta 479 zcmY+AO-sW-5Qg7LTH8cx(+{m}71a9OdQvwozecHMemUk}N!WA7$AW^qG$Gy7tzneji>X~@Mc1#bN<#asrrX$?o zllFpV+7Ft_g@WDSm#TTQYxWk~u5&l&i$CbWt8&4AVT)JS5O1mzzoH6ig9P z@+jF6d%26&$m^Kk>@coM5nGZ=je$6fA&4V`EON+KF@sqYc+R01rfDceDw(UI%y^#B z0*b+tTIMdL|EtQ6>LP1u*nL-79+L5&n8s) W6uu?JT8=Z-sXW5`H5JrGHSrH0-#Tvq delta 424 zcmYk1Jxc>Y5Qg8`O*E?)bABZn6*R{95y3)55J@3wB?uPU372C7ir&F-pjH-kcE|o9 z3x9xMVI!&i4OY%(4Q7|!nR(uKXPFoEQSg5*U%OI(z^nc3oo4j9 zcMHmViPlpN9`7P=@W0CbY?Bci1laD`(y}d%HgmU&3VD9n(^Va9LdnYJmO%8X_%> diff --git a/source/Enderal DLL/src/PapyrusFunctions.h b/source/Enderal DLL/src/PapyrusFunctions.h index c57420a5..e35ea7b4 100644 --- a/source/Enderal DLL/src/PapyrusFunctions.h +++ b/source/Enderal DLL/src/PapyrusFunctions.h @@ -47,6 +47,21 @@ namespace Papyrus::PapyrusFunctions return refr ? refr.get() : nullptr; } + inline std::vector GetPlayerFollowers(RE::StaticFunctionTag*) + { + std::vector result; + + if (const auto processLists = RE::ProcessLists::GetSingleton(); processLists) { + for (auto& actorHandle : processLists->highActorHandles) { + if (auto actor = actorHandle.get(); actor && actor->IsPlayerTeammate() && !actor->IsDead() && !actor->IsDisabled()) { + result.push_back(actor.get()); + } + } + } + + return result; + } + inline void Bind(VM& a_vm) { BIND(CreatePotion); @@ -55,5 +70,7 @@ namespace Papyrus::PapyrusFunctions logger::info("Registered GetNewGameCount"sv); BIND(GetCurrentContainer); logger::info("Registered GetCurrentContainer"sv); + BIND(GetPlayerFollowers); + logger::info("Registered GetPlayerFollowers"sv); } } diff --git a/source/scripts/enderalfunctions.psc b/source/scripts/enderalfunctions.psc index 5ef1a2ff..3d6770ec 100644 --- a/source/scripts/enderalfunctions.psc +++ b/source/scripts/enderalfunctions.psc @@ -8,6 +8,8 @@ ObjectReference function GetCurrentContainer() native global int function GetNewGameCount() native global +Actor[] function GetPlayerFollowers() native global + bool function IsDLLLoaded() global int iVer = SKSE.GetPluginVersion("EnderalSE") return iVer > 0