Skip to content

Commit

Permalink
feat: reverse engineered TESAIForm
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Dec 14, 2021
1 parent be717b6 commit 59cf6a2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Code/client/Games/Skyrim/Components/TESAIForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

#include <Components/BaseFormComponent.h>

struct TESPackage;

struct TESAIForm : BaseFormComponent
{
struct IntrusiveEntry
{
uintptr_t unk;
IntrusiveEntry* pNext;
};

uint32_t flags;
uint8_t unkC[0xC];
IntrusiveEntry head;
GameList<TESPackage*> AIPackList;
};

12 changes: 12 additions & 0 deletions Code/client/Games/Skyrim/Forms/TESPackage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "TESForm.h"

struct TESPackage : TESForm
{
uint8_t unk20[0xD8 - 0x20];
uint32_t ePROCEDURE_TYPE;
uint32_t uiRefCount;
};

static_assert(sizeof(TESPackage) == 0xE0);
12 changes: 12 additions & 0 deletions Code/client/Services/Generic/TestService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,18 @@ void TestService::OnDraw() noexcept
pFetchActor->magicTarget.AddTarget(data);
}
}

int packCount = 0;
if (auto* pNpc = RTTI_CAST(pFetchActor->baseForm, TESForm, TESNPC))
{
for (auto package : pNpc->aiForm.AIPackList)
{
packCount++;
}
}

ImGui::InputInt("Package count", &packCount, 0, 0, ImGuiInputTextFlags_ReadOnly);

#endif
}

Expand Down

0 comments on commit 59cf6a2

Please sign in to comment.