Skip to content

Commit

Permalink
fix: fix crash when casting spell on object
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Nov 20, 2021
1 parent 3f304bb commit 4ed0172
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Code/client/Games/Skyrim/Misc/MagicTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ bool TP_MAKE_THISCALL(HookAddTarget, MagicTarget, MagicTarget::AddTargetData& ar
Actor* pTargetActor = (Actor*)((char*)apThis - 0x98);
ActorExtension* pTargetActorEx = pTargetActor->GetExtension();

if (!pTargetActorEx)
return ThisCall(RealAddTarget, apThis, arData);

if (pTargetActorEx->IsLocalPlayer())
{
bool result = ThisCall(RealAddTarget, apThis, arData);
Expand Down

0 comments on commit 4ed0172

Please sign in to comment.