Using IsGMAccount instead of direct check

This commit is contained in:
Yehonal
2016-09-01 14:53:40 +02:00
parent b86f955f8d
commit cd2417eb2f
7 changed files with 19 additions and 15 deletions

View File

@@ -51,6 +51,7 @@
#include "WorldSession.h"
#include "ArenaSpectator.h"
#include "DynamicVisibility.h"
#include "AccountMgr.h"
#include <math.h>
@@ -19146,7 +19147,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
else if (index == UNIT_FIELD_FLAGS)
{
uint32 appendValue = m_uint32Values[UNIT_FIELD_FLAGS];
if (target->IsGameMaster() && target->GetSession()->GetSecurity() >= SEC_GAMEMASTER)
if (target->IsGameMaster() && AccountMgr::IsGMAccount(target->GetSession()->GetSecurity()))
appendValue &= ~UNIT_FLAG_NOT_SELECTABLE;
fieldBuffer << uint32(appendValue);
@@ -19171,7 +19172,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
{
if (target->IsGameMaster() && target->GetSession()->GetSecurity() >= SEC_GAMEMASTER)
if (target->IsGameMaster() && AccountMgr::IsGMAccount(target->GetSession()->GetSecurity()))
{
if (cinfo->Modelid1)
displayId = cinfo->Modelid1; // Modelid1 is a visible model for gms
@@ -19294,4 +19295,4 @@ void Unit::setRace(uint8 race)
{
if (GetTypeId() == TYPEID_PLAYER)
m_race = race;
}
}