*Fix a crash caused by recall pet. Thanks to nanouniko

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-26 21:17:47 -05:00
parent ef093eb9f0
commit a6e7a83644
+7 -4
View File
@@ -4131,14 +4131,17 @@ void Spell::EffectSummonPet(uint32 i)
if( OldSummon->isDead() ) if( OldSummon->isDead() )
return; return;
OldSummon->GetMap()->Remove((Creature*)OldSummon,false); assert(OldSummon->GetMap() == owner->GetMap());
//OldSummon->GetMap()->Remove((Creature*)OldSummon,false);
float px, py, pz; float px, py, pz;
owner->GetClosePoint(px, py, pz, OldSummon->GetObjectSize()); owner->GetClosePoint(px, py, pz, OldSummon->GetObjectSize());
OldSummon->Relocate(px, py, pz, OldSummon->GetOrientation()); OldSummon->NearTeleportTo(px, py, pz, OldSummon->GetOrientation());
OldSummon->SetMap(owner->GetMap()); //OldSummon->Relocate(px, py, pz, OldSummon->GetOrientation());
owner->GetMap()->Add((Creature*)OldSummon); //OldSummon->SetMap(owner->GetMap());
//owner->GetMap()->Add((Creature*)OldSummon);
if(owner->GetTypeId() == TYPEID_PLAYER && OldSummon->isControlled() ) if(owner->GetTypeId() == TYPEID_PLAYER && OldSummon->isControlled() )
{ {