Skip to content

Commit

Permalink
1.10.31 size corrections
Browse files Browse the repository at this point in the history
Only partially corrected offset comments
  • Loading branch information
expired6978 committed Mar 21, 2024
1 parent 3739caa commit 5b593fa
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 29 deletions.
19 changes: 12 additions & 7 deletions sfse/GameData.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class TESFile
BSTArray<TESFile*> masterFiles;
TESFileCollection fileCollection; // 1E0
u64 unk200;
u64 unkPad1; // Added in 1.10.31
u64 unkPad2; // Added in 1.10.31
u8 cCompileIndex; // 208
u16 sSmallFileCompileIndex; // 20A
u8 pad[3];
Expand All @@ -80,18 +82,18 @@ class TESFile
u32 unk248;
u32 unk24C;
};
static_assert(sizeof(TESFile) == 0x250);
static_assert(offsetof(TESFile, cCompileIndex) == 0x208);
static_assert(offsetof(TESFile, sSmallFileCompileIndex) == 0x20A);
static_assert(sizeof(TESFile) == 0x260); // Unverified after 1.10.31
static_assert(offsetof(TESFile, cCompileIndex) == 0x218);
static_assert(offsetof(TESFile, sSmallFileCompileIndex) == 0x21A);

class TESPackedFile : public TESFile
{
public:
virtual ~TESPackedFile();

u64 unk250[(0x3B8 - 0x250) >> 3];
u64 unk250[(0x3C8 - 0x260) >> 3];
};
static_assert(sizeof(TESPackedFile) == 0x3B8);
static_assert(sizeof(TESPackedFile) == 0x3C8); // Unverified after 1.10.31

class TESDataHandler :
public BSTEventSource<BGSHotloadCompletedEvent>
Expand Down Expand Up @@ -120,6 +122,9 @@ class TESDataHandler :
TESRegionList* unk1498;
BSTArray<TESObjectCELL*> unk14A0;
u64 unk14B0;
u64 unkPad1; // Added in 1.10.31
u64 unkPad2; // Added in 1.10.31
u64 unkPad3; // Added in 1.10.31
NiTPrimitiveArray<BGSAddonNode*> unk14B8;
u64 unk14D0;
u64 unk14D8;
Expand All @@ -137,8 +142,8 @@ class TESDataHandler :
}
};
static_assert(offsetof(TESDataHandler, pFormArray) == 0x70);
static_assert(offsetof(TESDataHandler, listFiles) == 0x14F0);
static_assert(offsetof(TESDataHandler, unk1520) == 0x1520);
static_assert(offsetof(TESDataHandler, listFiles) == 0x1508);
static_assert(offsetof(TESDataHandler, unk1520) == 0x1538);

struct MaterialDatabase
{
Expand Down
3 changes: 2 additions & 1 deletion sfse/GameFormComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class TESActorBaseData : public BaseFormComponent
ACTOR_BASE_DATA actorData; // 08
s32 unk1C; // 1C
u64 unk20; // 20
u64 unkPad; // Added in 1.10.31
u64 unk28; // 28
u64 unk30; // 30
u64 unk38; // 38
Expand All @@ -181,7 +182,7 @@ class TESActorBaseData : public BaseFormComponent
u64 unk60; // 60
u64 unk68; // 68
};
static_assert(sizeof(TESActorBaseData) == 0x70);
static_assert(sizeof(TESActorBaseData) == 0x78);

class TESContainer : public BaseFormComponent
{
Expand Down
8 changes: 4 additions & 4 deletions sfse/GameForms.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ struct OBJ_REFR
{
public:
// members
NiPoint3A angle; // 00
NiPoint3A location; // 10
TESForm* objectReference; // 20 - TESBoundObject
NiPoint3 angle; // 00
NiPoint3 location; // 0C
TESForm* objectReference; // 18 - TESBoundObject
};
static_assert(sizeof(OBJ_REFR) == 0x30);
static_assert(sizeof(OBJ_REFR) == 0x20);

class BGSListForm :
public TESForm
Expand Down
4 changes: 2 additions & 2 deletions sfse/GameObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class TESNPC :
u32 unk308; // 308
u32 unk30C; // 30C
TESClass* pCl; // 310
u64 unk318; // 318
//u64 unk318; // 318 - Removed 1.10.31
u64 unk320; // 320
TESCombatStyle* pCombatStyle; // 328
u32 unk330; // 330
Expand Down Expand Up @@ -175,6 +175,6 @@ class TESNPC :
DEFINE_MEMBER_FN_1(DeriveGeneticParentAppearance, void, 0x01AD3428, TESNPC* source);
DEFINE_MEMBER_FN_1(CopyAppearance, void, 0x01AD1860, TESNPC* source);
};
static_assert(sizeof(TESNPC) == 0x450);
static_assert(sizeof(TESNPC) == 0x450); // Un-verified after 1.10.31
static_assert(sizeof(TESNPC::HeadPartData) == 0x28);
static_assert(sizeof(TESNPC::InstanceData) == 0x158);
29 changes: 14 additions & 15 deletions sfse/GameReferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,26 +235,25 @@ class TESObjectREFR : public TESForm
void* ActorValueChangedEvent; // 70

// members
u64 unk78; // 78
OBJ_REFR data; // 80
u64 unkB0; // B0
u64 unkB8; // B8
TESObjectCELL* parentCell; // C0
void* loadedData; // C8
u64 unkF0; // D0
u64 extraDataList; // D8
u16 scale; // E0
u8 unkE2; // E2
u8 flags; // E3
OBJ_REFR data; // 78
u64 inventoryLock; // 98
void* inventoryList; // A0
TESObjectCELL* parentCell; // A8
void* loadedData; // B0
u64 unkF0; // B8
u64 extraDataList; // C0
u16 scale; // C8
u8 unkE2; // CB
u8 flags; // CC

DEFINE_MEMBER_FN_0(IsInSpaceship, bool, 0x02B2D0D4)
DEFINE_MEMBER_FN_0(IsInSpace, bool, 0x019B8180)
DEFINE_MEMBER_FN_1(HasKeyword, bool, 0x0131CED8, BGSKeyword*);
};
static_assert(offsetof(TESObjectREFR, data) == 0x80);
static_assert(offsetof(TESObjectREFR, parentCell) == 0xC0);
static_assert(offsetof(TESObjectREFR, scale) == 0xE0);
static_assert(sizeof(TESObjectREFR) == 0xF0);
static_assert(offsetof(TESObjectREFR, data) == 0x78);
static_assert(offsetof(TESObjectREFR, parentCell) == 0xA8);
static_assert(offsetof(TESObjectREFR, scale) == 0xC8);
static_assert(sizeof(TESObjectREFR) == 0xD0);

class Actor : public TESObjectREFR
{
Expand Down

0 comments on commit 5b593fa

Please sign in to comment.