Add IsSeatedState() to handle AURA_INTERRUPT_FLAG_NOT_SEATED.

* Update Unit.cpp

Add IsSeatedState() to handle AURA_INTERRUPT_FLAG_NOT_SEATED.

* Update Unit.h

Add IsSeatedState() to handle AURA_INTERRUPT_FLAG_NOT_SEATED.

* Update Unit.cpp

Pointer reference
This commit is contained in:
bdebaere 2017-06-29 01:22:20 +02:00 committed by Antz
parent 3a7e0253c1
commit 2eaea4fba9
2 changed files with 10 additions and 2 deletions

View File

@ -8801,12 +8801,18 @@ bool Unit::IsStandState() const
return !IsSitState() && s != UNIT_STAND_STATE_SLEEP && s != UNIT_STAND_STATE_KNEEL;
}
bool Unit::IsSeatedState() const
{
uint8 standState = getStandState();
return standState != UNIT_STAND_STATE_SLEEP && standState != UNIT_STAND_STATE_STAND;
}
void Unit::SetStandState(uint8 state)
{
SetByteValue(UNIT_FIELD_BYTES_1, 0, state);
if (IsStandState())
{ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_SEATED); }
if (!IsSeatedState())
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_SEATED);
if (GetTypeId() == TYPEID_PLAYER)
{

View File

@ -1785,6 +1785,8 @@ class Unit : public WorldObject
* @return true if the Unit is standing normally, false otherwise
*/
bool IsStandState() const;
bool IsSeatedState() const;
/**
* Change the stand state for this Unit. For possible values check
* UnitStandStateType.