*Remove some incorrect use of removefromworld in scripts.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-13 10:21:57 -05:00
parent c84f63d431
commit 656cb8a318
6 changed files with 16 additions and 13 deletions
@@ -517,7 +517,7 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI
{
//TODO: Found how to despawn and respawn
if(despawn)
(*itr)->RemoveFromWorld();
(*itr)->Delete();
else
(*itr)->Respawn();
}
@@ -730,7 +730,7 @@ void hyjalAI::DeSpawnVeins()
for (uint8 i = 0; i<7; i++)
{
if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i])))
gem->RemoveFromWorld();
gem->Delete();
}
}else if (Faction)
{
@@ -741,7 +741,7 @@ void hyjalAI::DeSpawnVeins()
for (uint8 i = 7; i<14; i++)
{
if(GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i])))
gem->RemoveFromWorld();
gem->Delete();
}
}
}
@@ -209,9 +209,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
{
for(uint8 i = 0; i < 3; i++)
{
Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i]);
if (add)
add->RemoveFromWorld();
if(Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i]))
add->DisappearAndDie();
float nx = x;
float ny = y;
@@ -282,7 +282,7 @@ bool GOHello_go_orb_of_the_blue_flight(Player *plr, GameObject* go)
if(Dyn){
Dyn->GetPosition(dx,dy,dz);
if(x == dx && dy == y && dz == z){
Dyn->RemoveFromWorld();
Dyn->Delete();
break;
}
}
@@ -369,7 +369,7 @@ struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI
if(Dyn){
Dyn->GetPosition(dx,dy,dz);
if(x == dx && dy == y && dz == z){
Dyn->RemoveFromWorld();
Dyn->Delete();
break;
}
}
@@ -64,9 +64,8 @@ struct TRINITY_DLL_DECL boss_emalonAI : public ScriptedAI
{
for(std::list<uint64>::const_iterator itr = MinionList.begin(); itr != MinionList.end(); itr++)
{
Unit *Minion = Unit::GetUnit(*m_creature, (*itr));
if(Minion)
Minion->RemoveFromWorld();
if(Creature *Minion = Unit::GetCreature(*m_creature, (*itr)))
Minion->DisappearAndDie();
}
}
@@ -220,8 +219,7 @@ struct TRINITY_DLL_DECL mob_tempest_minionAI : public ScriptedAI
void JustDied(Unit* Killer)
{
m_creature->RemoveCorpse();
m_creature->RemoveFromWorld();
m_creature->DisappearAndDie();
if(Emalon)
{
boss_emalonAI::SummonMinion(Emalon, Emalon->GetPositionX(), Emalon->GetPositionY(), Emalon->GetPositionZ(), Emalon->GetOrientation());
+6
View File
@@ -490,6 +490,12 @@ class TRINITY_DLL_SPEC Creature : public Unit
void AddToWorld();
void RemoveFromWorld();
void DisappearAndDie()
{
SetVisibility(VISIBILITY_OFF);
setDeathState(JUST_DIED);
}
bool Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, float x, float y, float z, float ang, const CreatureData *data = NULL);
bool LoadCreaturesAddon(bool reload = false);
void SelectLevel(const CreatureInfo *cinfo);