[9605] SetSummonPoint for any summoned creature.

Should fix a crash where summoned attempt moveRandom without having a valid summon point.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-03-18 14:04:47 +01:00
parent e11c4b4e03
commit a3de8da535
2 changed files with 5 additions and 1 deletions

View file

@ -3864,6 +3864,7 @@ void Spell::DoSummon(SpellEffectIndex eff_idx)
m_caster->GetClosePoint(x, y, z, spawnCreature->GetObjectSize()); m_caster->GetClosePoint(x, y, z, spawnCreature->GetObjectSize());
spawnCreature->Relocate(x, y, z, -m_caster->GetOrientation()); spawnCreature->Relocate(x, y, z, -m_caster->GetOrientation());
spawnCreature->SetSummonPoint(x, y, z, -m_caster->GetOrientation());
if (!spawnCreature->IsPositionValid()) if (!spawnCreature->IsPositionValid())
{ {
@ -4281,6 +4282,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
m_caster->GetClosePoint(px, py, pz,spawnCreature->GetObjectSize()); m_caster->GetClosePoint(px, py, pz,spawnCreature->GetObjectSize());
spawnCreature->Relocate(px, py, pz, m_caster->GetOrientation()); spawnCreature->Relocate(px, py, pz, m_caster->GetOrientation());
spawnCreature->SetSummonPoint(px, py, pz, m_caster->GetOrientation());
if (!spawnCreature->IsPositionValid()) if (!spawnCreature->IsPositionValid())
{ {
@ -6373,6 +6375,7 @@ void Spell::DoSummonTotem(SpellEffectIndex eff_idx, uint8 slot_dbc)
z = m_caster->GetPositionZ(); z = m_caster->GetPositionZ();
pTotem->Relocate(x, y, z, m_caster->GetOrientation()); pTotem->Relocate(x, y, z, m_caster->GetOrientation());
pTotem->SetSummonPoint(x, y, z, m_caster->GetOrientation());
if (slot < MAX_TOTEM_SLOT) if (slot < MAX_TOTEM_SLOT)
m_caster->_AddTotem(TotemSlot(slot),pTotem); m_caster->_AddTotem(TotemSlot(slot),pTotem);
@ -6877,6 +6880,7 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
m_caster->GetClosePoint(x, y, z, critter->GetObjectSize()); m_caster->GetClosePoint(x, y, z, critter->GetObjectSize());
critter->Relocate(x, y, z, m_caster->GetOrientation()); critter->Relocate(x, y, z, m_caster->GetOrientation());
critter->SetSummonPoint(x, y, z, m_caster->GetOrientation());
if(!critter->IsPositionValid()) if(!critter->IsPositionValid())
{ {

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9604" #define REVISION_NR "9605"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__