Skip to content

Commit 8c11aa6

Browse files
committed
Did some more testing. Found no issues, but did find some cleanup in MagicTarget.cpp.
1 parent befcac8 commit 8c11aa6

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

Code/client/Games/Skyrim/Actor.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ bool Actor::RemoveSpell(MagicItem* apSpell) noexcept
360360
if (!apSpell)
361361
{
362362
spdlog::error(__FUNCTION__ ": apSpell is null");
363-
return FALSE;
363+
return false;
364364
}
365365
// spdlog::info(__FUNCTION__ ": removing: {} from actor: {}", apSpell->formID, formID);
366366
return TiltedPhoques::ThisCall(RealRemoveSpell, this, apSpell);
@@ -388,9 +388,8 @@ bool TP_MAKE_THISCALL(HookRemoveSpell, Actor, MagicItem* apSpell)
388388
bool result = TiltedPhoques::ThisCall(RealRemoveSpell, apThis, apSpell);
389389
if (apThis->GetExtension()->IsLocalPlayer() && result)
390390
{
391-
// Log spell info
392-
// spdlog::info("Removing spell {}, ID: {} from local player", apSpell->GetName() , apSpell->formID);
393-
RemoveSpellEvent removalEvent;
391+
//spdlog::info(__FUNCTION__ ": spell: {}, ID: {} from local player", apSpell->GetName() , apSpell->formID);
392+
RemoveSpellEvent removalEvent;
394393

395394
removalEvent.TargetId = apThis->formID;
396395
removalEvent.SpellId = apSpell->formID;

Code/client/Games/Skyrim/Magic/MagicTarget.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <Effects/ActiveEffect.h>
1919

2020
TP_THIS_FUNCTION(TAddTarget, bool, MagicTarget, MagicTarget::AddTargetData& arData);
21-
TP_THIS_FUNCTION(TRemoveSpell, bool, Actor, MagicItem* apSpell);
2221
TP_THIS_FUNCTION(TCheckAddEffectTargetData, bool, MagicTarget::AddTargetData, void* arArgs, float afResistance);
2322
TP_THIS_FUNCTION(TFindTargets, bool, MagicCaster, float afEffectivenessMult, int32_t* aruiTargetCount,
2423
TESBoundObject* apSource, char abLoadCast, char abAdjust);
@@ -27,7 +26,6 @@ TP_THIS_FUNCTION(THasPerk, bool, Actor, TESForm* apPerk, void* apUnk1, double* a
2726
TP_THIS_FUNCTION(TGetPerkRank, uint8_t, Actor, TESForm* apPerk);
2827

2928
static TAddTarget* RealAddTarget = nullptr;
30-
static TRemoveSpell* RealRemoveSpell = nullptr;
3129
static TCheckAddEffectTargetData* RealCheckAddEffectTargetData = nullptr;
3230
static TFindTargets* RealFindTargets = nullptr;
3331
static TAdjustForPerks* RealAdjustForPerks = nullptr;
@@ -229,15 +227,13 @@ uint8_t TP_MAKE_THISCALL(HookGetPerkRank, Actor, TESForm* apPerk)
229227

230228
static TiltedPhoques::Initializer s_magicTargetHooks([]() {
231229
POINTER_SKYRIMSE(TAddTarget, addTarget, 34526);
232-
POINTER_SKYRIMSE(TRemoveSpell, removeSpell, 38717);
233230
POINTER_SKYRIMSE(TCheckAddEffectTargetData, checkAddEffectTargetData, 34525);
234231
POINTER_SKYRIMSE(TFindTargets, findTargets, 34410);
235232
POINTER_SKYRIMSE(TAdjustForPerks, adjustForPerks, 34053);
236233
POINTER_SKYRIMSE(THasPerk, hasPerk, 21622);
237234
POINTER_SKYRIMSE(TGetPerkRank, getPerkRank, 37698);
238235

239236
RealAddTarget = addTarget.Get();
240-
RealRemoveSpell = removeSpell.Get();
241237
RealCheckAddEffectTargetData = checkAddEffectTargetData.Get();
242238
RealFindTargets = findTargets.Get();
243239
RealAdjustForPerks = adjustForPerks.Get();

Code/client/Services/Generic/MagicService.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void MagicService::OnRemoveSpellEvent(const RemoveSpellEvent& acEvent) noexcept
447447

448448
request.TargetId = serverIdRes.value();
449449

450-
//spdlog::info("Requesting remove spell with base id {:X} from actor with server id {:X}", request.SpellId.BaseId, request.TargetId);
450+
//spdlog::info(__FUNCTION__ ": requesting remove spell with base id {:X} from actor with server id {:X}", request.SpellId.BaseId, request.TargetId);
451451

452452
m_transport.Send(request);
453453
}
@@ -479,7 +479,7 @@ void MagicService::OnNotifyRemoveSpell(const NotifyRemoveSpell& acMessage) noexc
479479
}
480480

481481
// Remove the spell from the actor
482-
//spdlog::info("Removing spell with form id {:X} from actor with form id {:X}", cSpellId, targetFormId);
482+
//spdlog::info(__FUNCTION__ ": removing spell with form id {:X} from actor with form id {:X}", cSpellId, targetFormId);
483483
pActor->RemoveSpell(pSpell);
484484
}
485485

Code/server/Services/MagicService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void MagicService::OnRemoveSpellRequest(const PacketEvent<RemoveSpellRequest>& a
7777
notify.TargetId = message.TargetId;
7878
notify.SpellId = message.SpellId;
7979

80-
//spdlog::info("RemoveSpellRequest: TargetId: {}, Spell baseId: {}", notify.TargetId, notify.SpellId.BaseId);
80+
//spdlog::info(__FUNCTION__ ": TargetId: {}, Spell baseId: {}", notify.TargetId, notify.SpellId.BaseId);
8181

8282
const auto entity = static_cast<entt::entity>(message.TargetId);
8383
if (!GameServer::Get()->SendToPlayersInRange(notify, entity, acMessage.GetSender()))

0 commit comments

Comments
 (0)