Skip to content

Commit

Permalink
Merge pull request #96 from RafearTheModder/PO3-PoachedBugsVR-RE-PR
Browse files Browse the repository at this point in the history
RE Work From Making Poached Bugs VR
  • Loading branch information
powerof3 authored Dec 20, 2023
2 parents 49d103b + c627db4 commit cca665b
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ set(SOURCES
include/RE/B/BGSEntryPointFunctionData.h
include/RE/B/BGSEntryPointFunctionDataActivateChoice.h
include/RE/B/BGSEntryPointFunctionDataOneValue.h
include/RE/B/BGSEntryPointFunctionDataSpellItem.h
include/RE/B/BGSEntryPointFunctionDataText.h
include/RE/B/BGSEntryPointPerkEntry.h
include/RE/B/BGSEquipSlot.h
Expand Down Expand Up @@ -709,6 +710,7 @@ set(SOURCES
include/RE/F/FavoritesMenu.h
include/RE/F/FightReactions.h
include/RE/F/FileID.h
include/RE/F/FindMaxMagnitudeVisitor.h
include/RE/F/FirstPersonState.h
include/RE/F/FixedStrings.h
include/RE/F/FlameProjectile.h
Expand Down Expand Up @@ -1754,6 +1756,7 @@ set(SOURCES
src/RE/E/ExtraSoul.cpp
src/RE/E/ExtraTextDisplayData.cpp
src/RE/E/ExtraUniqueID.cpp
src/RE/F/FindMaxMagnitudeVisitor.cpp
src/RE/F/FormTypes.cpp
src/RE/F/FxDelegate.cpp
src/RE/F/FxDelegateArgs.cpp
Expand Down
27 changes: 27 additions & 0 deletions include/RE/B/BGSEntryPointFunctionDataSpellItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include "RE/B/BGSEntryPointFunctionData.h"

namespace RE
{
class SpellItem;

class BGSEntryPointFunctionDataSpellItem : public BGSEntryPointFunctionData
{
public:
inline static constexpr auto RTTI = RTTI_BGSEntryPointFunctionDataSpellItem;
inline static constexpr auto VTABLE = VTABLE_BGSEntryPointFunctionDataSpellItem;
// Override
virtual ~BGSEntryPointFunctionDataSpellItem() override; // 0

// Override (BGSEntryPointFunctionData)
[[nodiscard]] virtual FunctionType GetType() const override; // 1
virtual bool LoadFunctionData(TESFile* a_mod) override; // 2
virtual void ResolveForms(TESFile* a_form) override; // 3

// Member variables
SpellItem* spell; // 8
};
static_assert(offsetof(BGSEntryPointFunctionDataSpellItem, spell) == 0x8);
static_assert(sizeof(BGSEntryPointFunctionDataSpellItem) == 0x10);
}
28 changes: 28 additions & 0 deletions include/RE/F/FindMaxMagnitudeVisitor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include "RE/M/MagicTarget.h"

namespace RE
{
class ActiveEffect;

class FindMaxMagnitudeVisitor :
public MagicTarget::ForEachActiveEffectVisitor
{
public:
inline static constexpr auto RTTI = RTTI_FindMaxMagnitudeVisitor;
inline static constexpr auto VTABLE = VTABLE_FindMaxMagnitudeVisitor;

virtual ~FindMaxMagnitudeVisitor(){}; // 00

// add
virtual BSContainer::ForEachResult Accept(ActiveEffect* a_effect) override; // 01

// Member variables
ActiveEffect* activeEffect{ nullptr }; // 8
float maxMagnitude{ -1.0F }; // 10
};
static_assert(sizeof(FindMaxMagnitudeVisitor) == 0x18);


} // namespace RE
2 changes: 1 addition & 1 deletion include/RE/M/MiddleHighProcessData.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ namespace RE
float unk2B0; // 2B0
float bleedoutRate; // 2B4
float unk2B8; // 2B8
float unk2BC; // 2BC
float maximumWardPower; // 2BC
float unk2C0; // 2C0
float torchEvaluationTimer; // 2C4
float alphaMult; // 2C8
Expand Down
2 changes: 2 additions & 0 deletions include/RE/Skyrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#include "RE/B/BGSEntryPointFunctionData.h"
#include "RE/B/BGSEntryPointFunctionDataActivateChoice.h"
#include "RE/B/BGSEntryPointFunctionDataOneValue.h"
#include "RE/B/BGSEntryPointFunctionDataSpellItem.h"
#include "RE/B/BGSEntryPointFunctionDataText.h"
#include "RE/B/BGSEntryPointPerkEntry.h"
#include "RE/B/BGSEquipSlot.h"
Expand Down Expand Up @@ -711,6 +712,7 @@
#include "RE/F/FavoritesMenu.h"
#include "RE/F/FightReactions.h"
#include "RE/F/FileID.h"
#include "RE/F/FindMaxMagnitudeVisitor.h"
#include "RE/F/FirstPersonState.h"
#include "RE/F/FixedStrings.h"
#include "RE/F/FlameProjectile.h"
Expand Down
13 changes: 13 additions & 0 deletions src/RE/F/FindMaxMagnitudeVisitor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include "RE/F/FindMaxMagnitudeVisitor.h"

namespace RE
{
BSContainer::ForEachResult FindMaxMagnitudeVisitor::Accept(ActiveEffect* a_effect)
{
using func_t = decltype(&FindMaxMagnitudeVisitor::Accept);
REL::Relocation<func_t> func{ reinterpret_cast<std::uintptr_t*>(RELOCATION_ID(257550, 205805).address())[0x1] }; // AE address/ID untested
return func(this, a_effect);
}
} // namespace RE

0 comments on commit cca665b

Please sign in to comment.