-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d711783
commit b1b233f
Showing
6 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "InvisibilityEffect.h" | ||
|
||
#include <Games/ActorExtension.h> | ||
#include <Forms/ActorValueInfo.h> | ||
|
||
TP_THIS_FUNCTION(TFinish, void, InvisibilityEffect); | ||
static TFinish* RealFinish = nullptr; | ||
|
||
// This needs to be done because the actor value does not update in time | ||
void TP_MAKE_THISCALL(HookFinish, InvisibilityEffect) | ||
{ | ||
if (apThis && apThis->pTarget) | ||
{ | ||
if (Actor* pActor = apThis->pTarget->GetTargetAsActor()) | ||
{ | ||
if (pActor->GetExtension()->IsRemote()) | ||
pActor->SetActorValue(ActorValueInfo::kInvisibility, 0.f); | ||
} | ||
} | ||
|
||
ThisCall(RealFinish, apThis); | ||
} | ||
|
||
static TiltedPhoques::Initializer s_invisibilityEffectsHooks([]() | ||
{ | ||
POINTER_SKYRIMSE(TFinish, s_finish, 34370); | ||
|
||
RealFinish = s_finish.Get(); | ||
|
||
TP_HOOK(&RealFinish, HookFinish); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include "ValueModifierEffect.h" | ||
|
||
struct InvisibilityEffect : ValueModifierEffect | ||
{ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters