Cleanup code for UNIT_FIELD_BYTES_1 parts.

Move defines to Unit (values can be used with creatures)
Better gameobject barber chairs check at loading.
This commit is contained in:
VladimirMangos 2009-01-31 05:47:02 +03:00
parent af888cda40
commit a1b5c3cb02
10 changed files with 75 additions and 76 deletions

View file

@ -945,7 +945,7 @@ void Aura::_AddAura()
{
// Sitdown on apply aura req seated
if (m_spellProto->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED && !m_target->IsSitState())
m_target->SetStandState(PLAYER_STATE_SIT);
m_target->SetStandState(UNIT_STAND_STATE_SIT);
// register aura diminishing on apply
if (getDiminishGroup() != DIMINISHING_NONE )
@ -3406,7 +3406,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
// only at real aura add
if(Real)
{
m_target->SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x02);
m_target->SetStandFlags(UNIT_STAND_FLAGS_CREEP);
if(m_target->GetTypeId()==TYPEID_PLAYER)
m_target->SetFlag(PLAYER_FIELD_BYTES2, 0x2000);
@ -3426,7 +3426,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
// if last SPELL_AURA_MOD_STEALTH and no GM invisibility
if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH) && m_target->GetVisibility()!=VISIBILITY_OFF)
{
m_target->SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x00);
m_target->RemoveStandFlags(UNIT_STAND_FLAGS_CREEP);
if(m_target->GetTypeId()==TYPEID_PLAYER)
m_target->RemoveFlag(PLAYER_FIELD_BYTES2, 0x2000);
@ -5282,9 +5282,9 @@ void Aura::HandleAuraEmpathy(bool apply, bool Real)
void Aura::HandleAuraUntrackable(bool apply, bool Real)
{
if(apply)
m_target->SetFlag(UNIT_FIELD_BYTES_1, PLAYER_STATE_FLAG_UNTRACKABLE);
m_target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE);
else
m_target->RemoveFlag(UNIT_FIELD_BYTES_1, PLAYER_STATE_FLAG_UNTRACKABLE);
m_target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE);
}
void Aura::HandleAuraModPacify(bool apply, bool Real)
@ -5451,7 +5451,7 @@ void Aura::HandleSpiritOfRedemption( bool apply, bool Real )
// set stand state (expected in this form)
if(!m_target->IsStandState())
m_target->SetStandState(PLAYER_STATE_NONE);
m_target->SetStandState(UNIT_STAND_STATE_STAND);
}
m_target->SetHealth(1);