mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
fix(Core/Misc): bunch of crashfixes (#7307)
This commit is contained in:
@@ -851,7 +851,7 @@ public:
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
GetUnitOwner()->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, owner->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID));
|
||||
GetUnitOwner()->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, owner->GetUInt32Value(PLAYER_VISIBLE_ITEM_17_ENTRYID));
|
||||
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
// xinef: chance of success stores proper amount of damage increase
|
||||
// xinef: little hack because GetSpellModOwner will return nullptr pointer at this point (early summoning stage)
|
||||
if (GetUnitOwner()->IsSummon())
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummonerUnit())
|
||||
if (Player* player = owner->GetSpellModOwner())
|
||||
player->ApplySpellMod(SPELL_DRUID_BARKSKIN, SPELLMOD_CHANCE_OF_SUCCESS, amount);
|
||||
}
|
||||
|
||||
@@ -3847,7 +3847,7 @@ public:
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (TempSummon* vehicle = caster->ToTempSummon())
|
||||
if (Unit* rider = vehicle->GetSummoner())
|
||||
if (Unit* rider = vehicle->GetSummonerUnit())
|
||||
rider->RemoveAurasDueToSpell(GetId());
|
||||
}
|
||||
|
||||
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetCaster()->GetGUID()))
|
||||
{
|
||||
aur->GetBase()->RefreshTimersWithMods();
|
||||
aur->GetBase()->RefreshTimers();
|
||||
aur->ChangeAmount(aur->CalculateAmount(aur->GetCaster()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* owner = target->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = target->ToTempSummon()->GetSummonerUnit())
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
owner->ToPlayer()->KilledMonsterCredit(23327); // Some trigger, just count
|
||||
}
|
||||
|
||||
@@ -764,7 +764,7 @@ public:
|
||||
// Refresh corruption on target
|
||||
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID()))
|
||||
{
|
||||
aur->GetBase()->RefreshTimersWithMods();
|
||||
aur->GetBase()->RefreshTimers();
|
||||
aur->ChangeAmount(aur->CalculateAmount(aur->GetCaster()), false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user