Skip to content

Commit

Permalink
fix BGSPerkEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-rsm-McKenzie committed Jun 2, 2020
1 parent 141890e commit 887d7cf
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 52 deletions.
2 changes: 2 additions & 0 deletions CommonLibSSE.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<ProjectGuid>{3e4b6ef3-ec6e-46cf-9003-eeb57a258b82}</ProjectGuid>
<RootNamespace>CommonLibSSE</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-custom</VcpkgTriplet>
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-custom</VcpkgTriplet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ namespace RE
virtual ~BGSAbilityPerkEntry(); // 00

// override (BGSPerkEntry)
virtual Type GetType() const override; // 04 - { return kAbility; }
virtual void ResolveForms(TESFile* a_mod); // 06
virtual bool LoadPerk(TESFile* a_mod) override; // 07
virtual void Unk_0A(void) override; // 0A
virtual void Unk_0B(void) override; // 0B
virtual PERK_ENTRY_TYPE GetType() const override; // 04 - { return kAbility; }
virtual void InitItem(TESFile* a_owner) override; // 06
virtual bool Load(TESFile* a_file) override; // 07
virtual void ApplyPerkEntry(Actor* a_actor) override; // 0A
virtual void RemovePerkEntry(Actor* a_actor) override; // 0B


// members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace RE

struct EntryData // DATA
{
public:
enum class Function : UInt8
{
kSetValue = 1,
Expand All @@ -39,6 +40,7 @@ namespace RE
};


// members
EntryPoint entryPoint; // 0
Function function; // 1
UInt8 numArgs; // 2
Expand All @@ -49,20 +51,20 @@ namespace RE


// override (BGSPerkEntry)
virtual bool EvaluateConditions(UInt32 a_numArgs, void* a_args) override; // 00
virtual EntryPoint GetEntryPoint() const override; // 01 { return entryPoint; }
virtual BGSEntryPointFunctionData* GetFunctionData() const override; // 02 { return functionData; }
virtual bool CheckConditionFilters(UInt32 a_numArgs, void* a_args) override; // 00
virtual EntryPoint GetFunction() override; // 01 - { return function; }
virtual void* GetFunctionData() const override; // 02 - { return functionData; }

virtual ~BGSEntryPointPerkEntry(); // 03

virtual Type GetType() const override; // 04 - { return kEntryPoint; }
virtual void ReleaseRefs() override; // 05
virtual void ResolveForms(TESFile* a_mod) override; // 06
virtual bool LoadPerk(TESFile* a_mod) override; // 07
virtual void SetPerk(BGSPerk* a_perk) override; // 08
virtual void Unk_09(void) override; // 09
virtual void Unk_0A(void) override; // 0A
virtual void Unk_0B(void) override; // 0B
virtual PERK_ENTRY_TYPE GetType() const override; // 04 - { return kEntryPoint; }
virtual void ClearData() override; // 05
virtual void InitItem(TESFile* a_owner) override; // 06
virtual bool Load(TESFile* a_file) override; // 07
virtual void SetParent(BGSPerk* a_parent) override; // 08
virtual UInt16 GetID() const override; // 09
virtual void ApplyPerkEntry(Actor* a_actor) override; // 0A
virtual void RemovePerkEntry(Actor* a_actor) override; // 0B

bool IsEntryPoint(EntryPoint a_entryPoint) const;

Expand Down
41 changes: 22 additions & 19 deletions include/RE/FormComponents/Components/BGSPerkEntry/BGSPerkEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@

namespace RE
{
class Actor;
class BGSEntryPointFunctionData;
class TESFile;


enum class PERK_ENTRY_TYPE : UInt32
{
kQuest = 0,
kAbility = 1,
kEntryPoint = 2
};


class BGSPerkEntry
{
public:
Expand All @@ -19,16 +28,10 @@ namespace RE
using EntryPoint = BGSEntryPoint::ENTRY_POINT;


enum class Type
{
kQuestStage = 0,
kAbility = 1,
kEntryPoint = 2
};


struct Header // PRKE
{
public:
// members
UInt8 rank; // 0
UInt8 priority; // 1
UInt16 unk2; // 2
Expand All @@ -37,20 +40,20 @@ namespace RE
STATIC_ASSERT(sizeof(Header) == 0x8);


virtual bool EvaluateConditions(UInt32 a_numArgs, void* a_args); // 00 - { return false; }
virtual EntryPoint GetEntryPoint() const; // 01 - { return 0; }
virtual BGSEntryPointFunctionData* GetFunctionData() const; // 02 - { return 0; }
virtual bool CheckConditionFilters(UInt32 a_numArgs, void* a_args); // 00 - { return false; }
virtual EntryPoint GetFunction(); // 01 - { return 0; }
virtual void* GetFunctionData() const; // 02 - { return 0; }

virtual ~BGSPerkEntry(); // 03

virtual Type GetType() const = 0; // 04
virtual void ReleaseRefs(); // 05 - { return; }
virtual void ResolveForms(TESFile* a_mod); // 06 - { return; }
virtual bool LoadPerk(TESFile* a_mod); // 07 - { return true; }
virtual void SetPerk(BGSPerk* a_perk); // 08 - { return; }
virtual void Unk_09(void); // 09 - { return 0xFFFF; }
virtual void Unk_0A(void) = 0; // 0A
virtual void Unk_0B(void) = 0; // 0B
virtual PERK_ENTRY_TYPE GetType() const = 0; // 04
virtual void ClearData(); // 05 - { return; }
virtual void InitItem(TESFile* a_owner); // 06 - { return; }
virtual bool Load(TESFile* a_file); // 07 - { return true; }
virtual void SetParent(BGSPerk* a_parent); // 08 - { return; }
virtual UInt16 GetID() const; // 09 - { return 0xFFFF; }
virtual void ApplyPerkEntry(Actor* a_actor) = 0; // 0A
virtual void RemovePerkEntry(Actor* a_actor) = 0; // 0B

UInt8 GetRank() const;
UInt8 GetPriority() const;
Expand Down
34 changes: 17 additions & 17 deletions include/SKSE/Impl/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator+(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator+(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -45,7 +45,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator+=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator+=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -61,7 +61,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator-(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator-(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -77,7 +77,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator-=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator-=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -93,7 +93,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator~(Enum a_val) noexcept
[[nodiscard]] constexpr Enum operator~(Enum a_val) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(~static_cast<underlying_type_t>(a_val));
Expand All @@ -107,7 +107,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator&(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator&(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -123,7 +123,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator&=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator&=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -139,7 +139,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator|(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator|(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -155,7 +155,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator|=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator|=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -171,7 +171,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator^(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator^(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -187,7 +187,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator^=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator^=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -203,7 +203,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator<<(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator<<(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -218,7 +218,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator<<=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator<<=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -233,7 +233,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator>>(Enum a_lhs, Enum a_rhs) noexcept
[[nodiscard]] constexpr Enum operator>>(Enum a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return static_cast<Enum>(
Expand All @@ -248,7 +248,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator>>=(Enum& a_lhs, Enum a_rhs) noexcept
constexpr Enum& operator>>=(Enum& a_lhs, Enum a_rhs) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_lhs = static_cast<Enum>(
Expand All @@ -264,7 +264,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
constexpr inline Enum& operator++(Enum& a_this) noexcept
constexpr Enum& operator++(Enum& a_this) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
return a_this = static_cast<Enum>(
Expand All @@ -280,7 +280,7 @@ template <
std::is_enum_v<
Enum>,
int> = 0>
[[nodiscard]] constexpr inline Enum operator++(Enum& a_this, int) noexcept
[[nodiscard]] constexpr Enum operator++(Enum& a_this, int) noexcept
{
using underlying_type_t = std::underlying_type_t<Enum>;
auto tmp = a_this;
Expand Down

0 comments on commit 887d7cf

Please sign in to comment.