Added GetPlayerFollowers() to EnderalSE.dll

This commit is contained in:
Eddoursul 2022-08-10 21:04:23 +02:00
parent 3073987a97
commit 655d84bc41
4 changed files with 21 additions and 2 deletions

BIN
SKSE/Plugins/EnderalSE.dll (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

View File

@ -47,6 +47,21 @@ namespace Papyrus::PapyrusFunctions
return refr ? refr.get() : nullptr; return refr ? refr.get() : nullptr;
} }
inline std::vector<RE::Actor*> GetPlayerFollowers(RE::StaticFunctionTag*)
{
std::vector<RE::Actor*> 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) inline void Bind(VM& a_vm)
{ {
BIND(CreatePotion); BIND(CreatePotion);
@ -55,5 +70,7 @@ namespace Papyrus::PapyrusFunctions
logger::info("Registered GetNewGameCount"sv); logger::info("Registered GetNewGameCount"sv);
BIND(GetCurrentContainer); BIND(GetCurrentContainer);
logger::info("Registered GetCurrentContainer"sv); logger::info("Registered GetCurrentContainer"sv);
BIND(GetPlayerFollowers);
logger::info("Registered GetPlayerFollowers"sv);
} }
} }

View File

@ -8,6 +8,8 @@ ObjectReference function GetCurrentContainer() native global
int function GetNewGameCount() native global int function GetNewGameCount() native global
Actor[] function GetPlayerFollowers() native global
bool function IsDLLLoaded() global bool function IsDLLLoaded() global
int iVer = SKSE.GetPluginVersion("EnderalSE") int iVer = SKSE.GetPluginVersion("EnderalSE")
return iVer > 0 return iVer > 0