mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Spell: Fixed compile broken in 11fb0beaf0 and renamed _player to player.
This commit is contained in:
@@ -2093,10 +2093,10 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Player* _player = unitTarget->ToPlayer();
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
uint32 spellToUnlearn = m_spellInfo->Effects[effIndex].TriggerSpell;
|
||||
|
||||
_player->removeSpell(spellToUnlearn);
|
||||
player->removeSpell(spellToUnlearn);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", _player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow());
|
||||
}
|
||||
@@ -5875,16 +5875,15 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
Player* player = m_caster->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Player* _player = m_caster->ToPlayer();
|
||||
|
||||
Item* foodItem = itemTarget;
|
||||
if (!foodItem)
|
||||
return;
|
||||
|
||||
Pet* pet = _player->GetPet();
|
||||
Pet* pet = player->GetPet();
|
||||
if (!pet)
|
||||
return;
|
||||
|
||||
@@ -5898,7 +5897,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
|
||||
ExecuteLogEffectDestroyItem(effIndex, foodItem->GetEntry());
|
||||
|
||||
uint32 count = 1;
|
||||
_player->DestroyItemCount(foodItem, count, true);
|
||||
player->DestroyItemCount(foodItem, count, true);
|
||||
// TODO: fix crash when a spell has two effects, both pointed at the same item target
|
||||
|
||||
m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, NULL, NULL, true);
|
||||
@@ -6097,7 +6096,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Player* _player = unitTarget->ToPlayer();
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
|
||||
int32 rep_change = damage;
|
||||
|
||||
@@ -6114,10 +6113,10 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
|
||||
}
|
||||
|
||||
// Bonus from spells that increase reputation gain
|
||||
float bonus = rep_change * _player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
|
||||
float bonus = rep_change * player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
|
||||
rep_change += (int32)bonus;
|
||||
|
||||
_player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
|
||||
player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
|
||||
}
|
||||
|
||||
void Spell::EffectQuestComplete(SpellEffIndex effIndex)
|
||||
@@ -6432,12 +6431,11 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||
return;
|
||||
|
||||
Player* _player = m_caster->ToPlayer()
|
||||
|
||||
if (!_player)
|
||||
Player* player = m_caster->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Pet* pet = _player->GetPet();
|
||||
Pet* pet = player->GetPet();
|
||||
if (!pet || pet->isAlive())
|
||||
return;
|
||||
|
||||
@@ -6445,8 +6443,8 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
_player->GetPosition(x, y, z);
|
||||
_player->GetMap()->CreatureRelocation(pet, x, y, z, _player->GetOrientation());
|
||||
player->GetPosition(x, y, z);
|
||||
player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation());
|
||||
|
||||
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
@@ -6455,7 +6453,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
|
||||
|
||||
//pet->AIM_Initialize();
|
||||
//_player->PetSpellInitialize();
|
||||
//player->PetSpellInitialize();
|
||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user