diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-04-25 23:42:40 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-04-25 23:42:40 +0200 |
| commit | 1390621f4da88d6749e42bea0a131fae74742fa4 (patch) | |
| tree | 5c6b3c03866feb85ade9f5f95b5cb7cbd5617f61 /src/server/game/Spells/SpellEffects.cpp | |
| parent | 7edfbaeb6ee667584b14fc3f59189aa762ae38c5 (diff) | |
| parent | c81d6e9b4bec14a46fd4eb01ce51d874a12bf5f7 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Handlers/MiscHandler.cpp
src/server/scripts/Commands/cs_reload.cpp
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a8ceedd970e..d2fa8650c13 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2129,7 +2129,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) pos = *destTarget; else // randomize position for multiple summons - m_caster->GetRandomPoint(*destTarget, radius, pos); + pos = m_caster->GetRandomPoint(*destTarget, radius); summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); if (!summon) @@ -4305,9 +4305,8 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/) if (!m_targets.HasDst()) return; - Position pos; - destTarget->GetPosition(&pos); - unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f); + Position pos = destTarget->GetPosition(); + pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f); unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster); } @@ -4445,9 +4444,8 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/) // Spell is not using explicit target - no generated path if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK) { - Position pos; - unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); - unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster)); + //unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); + Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster)); m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ); } else @@ -4469,11 +4467,10 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/) if (m_targets.HasDst()) { - Position pos; - destTarget->GetPosition(&pos); + Position pos = destTarget->GetPosition(); float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY()); float dist = m_caster->GetDistance(pos); - m_caster->GetFirstCollisionPosition(pos, dist, angle); + pos = m_caster->GetFirstCollisionPosition(dist, angle); m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ); } @@ -5406,7 +5403,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* pos = *destTarget; else // randomize position for multiple summons - m_caster->GetRandomPoint(*destTarget, radius, pos); + pos = m_caster->GetRandomPoint(*destTarget, radius); TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id); if (!summon) @@ -5650,10 +5647,7 @@ void Spell::EffectBind(SpellEffIndex effIndex) if (m_targets.HasDst()) homeLoc.WorldRelocate(*destTarget); else - { - player->GetPosition(&homeLoc); - homeLoc.m_mapId = player->GetMapId(); - } + homeLoc = player->GetWorldLocation(); player->SetHomebind(homeLoc, areaId); @@ -5737,9 +5731,9 @@ void Spell::EffectCreateAreaTrigger(SpellEffIndex effIndex) Position pos; if (!m_targets.HasDst()) - GetCaster()->GetPosition(&pos); + pos = GetCaster()->GetPosition(); else - destTarget->GetPosition(&pos); + pos = destTarget->GetPosition(); // trigger entry/miscvalue relation is currently unknown, for now use MiscValue as trigger entry uint32 triggerEntry = GetSpellInfo()->Effects[effIndex].MiscValue; |
