From 767d6ba23e776d0b40b2888696f3ae120bf5f375 Mon Sep 17 00:00:00 2001 From: powerof3 <32599957+powerof3@users.noreply.github.com> Date: Sat, 27 Jan 2024 00:03:16 +0530 Subject: [PATCH] Add `Actor::IsDualCasting` --- include/RE/A/Actor.h | 1 + src/RE/A/Actor.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/RE/A/Actor.h b/include/RE/A/Actor.h index 656bc0e73..258e2e95b 100644 --- a/include/RE/A/Actor.h +++ b/include/RE/A/Actor.h @@ -573,6 +573,7 @@ namespace RE bool IsCasting(MagicItem* a_spell) const; bool IsCommandedActor() const; bool IsCurrentShout(SpellItem* a_power); + bool IsDualCasting() const; bool IsEssential() const; bool IsFactionInCrimeGroup(const TESFaction* a_faction) const; bool IsGhost() const; diff --git a/src/RE/A/Actor.cpp b/src/RE/A/Actor.cpp index cfc81a100..1d330057a 100644 --- a/src/RE/A/Actor.cpp +++ b/src/RE/A/Actor.cpp @@ -749,14 +749,24 @@ namespace RE return boolFlags.all(BOOL_FLAGS::kIsCommandedActor); } - bool Actor::IsCurrentShout(SpellItem* a_spell) + bool Actor::IsCurrentShout(SpellItem* a_power) { using func_t = decltype(&Actor::IsCurrentShout); REL::Relocation func{ RELOCATION_ID(37858, 38812) }; - return func(this, a_spell); + return func(this, a_power); + } + + bool Actor::IsDualCasting() const + { + if (!currentProcess) { + return false; + } + + const auto highProcess = currentProcess->high; + return highProcess && highProcess->isDualCasting; } - bool Actor::IsEssential() const + bool Actor::IsEssential() const { return boolFlags.all(BOOL_FLAGS::kEssential); }