[8023] Move guardian list at Unit level and unsummon guardians at owner-creature death/unload.

This expected to fix well known crash at intances unload with creature with summoned guardians.
Note: this "fix" special case but not original source of problem in general.
This commit is contained in:
VladimirMangos 2009-06-15 23:43:15 +04:00
parent 02a71edb86
commit 309ac7ead0
6 changed files with 56 additions and 46 deletions

View file

@ -3711,8 +3711,7 @@ void Spell::EffectSummonGuardian(uint32 i)
spawnCreature->AIM_Initialize();
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddGuardian(spawnCreature);
m_caster->AddGuardian(spawnCreature);
map->Add((Creature*)spawnCreature);
}