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:
parent
3a7e0253c1
commit
2eaea4fba9
@ -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)
|
||||
{
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user