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 d590081d..e4f711af 100644 Binary files a/scripts/enderalfunctions.pex and b/scripts/enderalfunctions.pex differ 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