Skip to content

Commit

Permalink
RE fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shad0wshayd3 committed May 16, 2024
1 parent 43fd270 commit ae91c5e
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 54 deletions.
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/ActorValueInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace RE
[[nodiscard]] static ActorValue* GetSingleton()
{
using func_t = decltype(&ActorValue::GetSingleton);
REL::Relocation<func_t> func{ REL::ID(405390) };
REL::Relocation<func_t> func{ REL::ID(2189587) };
return func();
}

Expand Down
44 changes: 24 additions & 20 deletions CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,47 @@ namespace RE
{
public:
// members
float questDelayTime; // 0
std::uint16_t flags; // 4
std::int8_t priority; // 6
std::int8_t questType; // 7
float questDelayTime; // 00
std::uint16_t flags; // 04
std::int8_t priority; // 06
std::int8_t questType; // 07
};
static_assert(sizeof(QUEST_DATA) == 0x8);

class BGSQuestInstanceText
{
public:
static void ParseString(BSStringT<char>* inOutText, const TESQuest* quest, std::uint32_t instanceID)
{
using func_t = decltype(&BGSQuestInstanceText::ParseString);
REL::Relocation<func_t> func{ REL::ID(2206630) };
return func(inOutText, quest, instanceID);
}

struct StringData
{
std::uint32_t aliasID;
std::uint32_t fullNameFormID;
public:
// members
std::uint32_t aliasID; // 00
std::uint32_t fullNameFormID; // 04
};
static_assert(sizeof(StringData) == 0x8);

struct GlobabValueData
{
const TESGlobal* globab;
float value;
public:
// members
const TESGlobal* global; // 00
float value; // 08
};
static_assert(sizeof(GlobabValueData) == 0x10);

static void ParseString(BSStringT<char>* a_inOutText, const TESQuest* a_quest, std::uint32_t a_instanceID)
{
using func_t = decltype(&BGSQuestInstanceText::ParseString);
REL::Relocation<func_t> func{ REL::ID(2206630) };
return func(a_inOutText, a_quest, a_instanceID);
}

// Members
std::uint32_t ID; // 00
BSTArray<BGSQuestInstanceText::StringData> StringData; // 08
BSTArray<BGSQuestInstanceText::GlobabValueData> ValueData; // 20
std::uint16_t JournalStage; // 38
std::uint16_t JournalStageItem; // 3A
std::uint32_t id; // 00
BSTArray<BGSQuestInstanceText::StringData> stringData; // 08
BSTArray<BGSQuestInstanceText::GlobabValueData> valueData; // 20
std::uint16_t journalStage; // 38
std::uint16_t journalStageItem; // 3A
};
static_assert(sizeof(BGSQuestInstanceText) == 0x40);

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ namespace RE
static constexpr auto VTABLE{ VTABLE::ExtraHealth };
static constexpr auto TYPE{ EXTRA_DATA_TYPE::kHealth };

ExtraHealth(float health) :
ExtraHealth(float a_health) :
BSExtraData(TYPE),
health(health)
health(a_health)
{
stl::emplace_vtable(this);
}
Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ namespace RE
public:
[[nodiscard]] static TESInitScriptEventSource* GetSingleton()
{
REL::Relocation<TESInitScriptEventSource*> singleton{ REL::ID(444105) }; // Needs updating.
REL::Relocation<TESInitScriptEventSource*> singleton{ REL::ID(2691330) };
return singleton.get();
}
};
Expand Down
24 changes: 16 additions & 8 deletions CommonLibF4/include/RE/Bethesda/PipboyDataGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@

namespace RE
{
class PipboyDataGroup : BSTEventSource<PipboyValueChangedEvent>
class PipboyThrottleManager;

class PipboyDataGroup :
public BSTEventSource<PipboyValueChangedEvent> // 00
{
public:
static constexpr auto RTTI{ RTTI::PipboyDataGroup };
static constexpr auto VTABLE{ VTABLE::PipboyDataGroup };

virtual ~PipboyDataGroup();
virtual ~PipboyDataGroup(); // 00

// override
virtual BSEventNotifyControl ProcessEvent(const PipboyValueChangedEvent& a_event, BSTEventSource<PipboyValueChangedEvent>* a_source); // 01

virtual void Populate(bool);
virtual void DoClearData();
virtual void DoClearSink();
// add
virtual void Populate(bool a_arg1) = 0; // 02
virtual void DoClearData() = 0; // 03
virtual void DoClearSink() = 0; // 04

REX::W32::CRITICAL_SECTION PipboyDataMutex;
void* rThrottleManager; // PipboyThrottleManager
PipboyValue* rootValue;
// members
REX::W32::CRITICAL_SECTION pipboyDataMutex; // 60
PipboyThrottleManager* throttleManager; // 88
PipboyValue* rootValue; // 90
};
static_assert(sizeof(PipboyDataGroup) == 0x98);
}
57 changes: 35 additions & 22 deletions CommonLibF4/include/RE/Bethesda/PipboyValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

namespace RE
{
namespace Json
{
class Value;
}

class BSBinarySerializer;
class PipboyObject;

class __declspec(novtable) PipboyValue
Expand All @@ -16,23 +22,24 @@ namespace RE

enum SERIALIZATION_DATA_TYPE : std::uint8_t
{
SDT_BOOL = 0x0,
SDT_INT_8 = 0x1,
SDT_UINT_8 = 0x2,
SDT_INT_32 = 0x3,
SDT_UINT_32 = 0x4,
SDT_FLOAT = 0x5,
SDT_STRING = 0x6,
SDT_ARRAY = 0x7,
SDT_OBJECT = 0x8,
kBool = 0x0,
kInt8 = 0x1,
kUint8 = 0x2,
kInt32 = 0x3,
kUint32= 0x4,
kFloat = 0x5,
kString = 0x6,
kArray = 0x7,
kObject = 0x8,
};

virtual ~PipboyValue(); // 00

virtual ~PipboyValue();

virtual void CleanDirtyToGame();
virtual void Serialize(void* a_args1);
virtual void SerializeChanged(void* a_args1);
virtual SERIALIZATION_DATA_TYPE GetType();
// add
virtual void CleanDirtyToGame(); // 01
virtual void Serialize(Json::Value* a_json) = 0; // 02
virtual void SerializeChanges(BSBinarySerializer& a_serializer, bool a_fullSerialize); // 03
virtual SERIALIZATION_DATA_TYPE GetType() = 0; // 04

// members
std::uint32_t id; // 08
Expand All @@ -43,19 +50,25 @@ namespace RE
static_assert(sizeof(PipboyValue) == 0x18);

class __declspec(novtable) PipboyObject :
PipboyValue
public PipboyValue
{
public:
static constexpr auto RTTI{ RTTI::PipboyObject };
static constexpr auto VTABLE{ VTABLE::PipboyObject };

virtual ~PipboyObject();
virtual ~PipboyObject(); // 00

//members
BSTHashMap<BSFixedString, PipboyValue*> memberMap;
BSTSet<std::uint32_t> addedMemberIDs;
BSTArray<std::uint32_t> removedMemberIDs;
bool newlyCreated;
// override
virtual void CleanDirtyToGame() override; // 01
virtual void Serialize(Json::Value* a_json) override; // 02
virtual void SerializeChanges(BSBinarySerializer& a_serializer, bool a_fullSerialize) override; // 03
virtual SERIALIZATION_DATA_TYPE GetType() override; // 04

// members
BSTHashMap<BSFixedString, PipboyValue*> memberMap; // 18
BSTSet<std::uint32_t> addedMemberIDs; // 48
BSTArray<std::uint32_t> removedMemberIDs; // 78
bool newlyCreated; // 90
};
static_assert(sizeof(PipboyObject) == 0x98);
}

0 comments on commit ae91c5e

Please sign in to comment.