Core/Units: Rename and change Get/SetVisibility to use a bool value instead of an unnecessary enum
Also replace some SetVisibility hacks to directly call UpdateObjectVisibility --HG-- branch : trunk
This commit is contained in:
@@ -265,7 +265,7 @@ AOEAI::AOEAI(Creature *c) : CreatureAI(c)
|
||||
if (!me->m_spells[0])
|
||||
sLog.outError("AOEAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
|
||||
|
||||
me->SetVisibility(VISIBILITY_ON);//visible to see all spell anims
|
||||
me->SetVisible(true);//visible to see all spell anims
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//can't be targeted
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1);//can't be damaged
|
||||
me->SetDisplayId(11686);//invisible model,around a size of a player
|
||||
@@ -308,7 +308,7 @@ void VehicleAI::UpdateAI(const uint32 diff)
|
||||
if (m_DismissTimer < diff)
|
||||
{
|
||||
m_DoDismiss = false;
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
me->ForcedDespawn();
|
||||
}else m_DismissTimer -= diff;
|
||||
}
|
||||
@@ -316,7 +316,7 @@ void VehicleAI::UpdateAI(const uint32 diff)
|
||||
|
||||
void VehicleAI::Reset()
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
|
||||
m_vehicle->Reset();
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
me->SetPhaseMask(action.raw.param1, true);
|
||||
break;
|
||||
case ACTION_T_SET_VISIBILITY:
|
||||
me->SetVisibility(UnitVisibility(action.raw.param1));
|
||||
me->SetVisible(bool(action.raw.param1));
|
||||
break;
|
||||
case ACTION_T_SET_ACTIVE:
|
||||
me->setActive(action.raw.param1 ? true : false);
|
||||
|
||||
@@ -79,7 +79,7 @@ void SmartAI::UpdateDespawn(const uint32 diff)
|
||||
{
|
||||
if (mDespawnState == 2)
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
mDespawnTime = 5000;
|
||||
mDespawnState++;
|
||||
}
|
||||
@@ -544,7 +544,7 @@ void SmartAI::JustRespawned()
|
||||
mDespawnTime = 0;
|
||||
mDespawnState = 0;
|
||||
mEscortState = SMART_ESCORT_NONE;
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
if (me->getFaction() != me->GetCreatureInfo()->faction_A)
|
||||
me->RestoreFaction();
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
|
||||
|
||||
@@ -681,7 +681,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
|
||||
case SMART_ACTION_SET_VISIBILITY:
|
||||
{
|
||||
if (me)
|
||||
me->SetVisibility(e.action.visibility.state ? VISIBILITY_ON : VISIBILITY_OFF);
|
||||
me->SetVisible(e.action.visibility.state ? true : false);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_ACTIVE:
|
||||
|
||||
Reference in New Issue
Block a user