mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
Using IsGMAccount instead of direct check
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "World.h"
|
||||
#include "Transport.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MovableMapObject(),
|
||||
m_model(NULL), m_goValue(), m_AI(NULL)
|
||||
@@ -2253,7 +2254,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
return;
|
||||
|
||||
bool forcedFlags = GetGoType() == GAMEOBJECT_TYPE_CHEST && GetGOInfo()->chest.groupLootRules && HasLootRecipient();
|
||||
bool targetIsGM = target->IsGameMaster() && target->GetSession()->GetSecurity() >= SEC_GAMEMASTER;
|
||||
bool targetIsGM = target->IsGameMaster() && AccountMgr::IsGMAccount(target->GetSession()->GetSecurity());
|
||||
|
||||
ByteBuffer fieldBuffer;
|
||||
|
||||
|
||||
@@ -2988,14 +2988,14 @@ void Player::SetGameMaster(bool on)
|
||||
if (on)
|
||||
{
|
||||
m_ExtraFlags |= PLAYER_EXTRA_GM_ON;
|
||||
if (GetSession()->GetSecurity() >= SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(GetSession()->GetSecurity()))
|
||||
setFaction(35);
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
|
||||
SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
|
||||
|
||||
if (Pet* pet = GetPet())
|
||||
{
|
||||
if (GetSession()->GetSecurity() >= SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(GetSession()->GetSecurity()))
|
||||
pet->setFaction(35);
|
||||
pet->getHostileRefManager().setOnlineOfflineState(false);
|
||||
}
|
||||
@@ -3007,7 +3007,7 @@ void Player::SetGameMaster(bool on)
|
||||
CombatStopWithPets();
|
||||
|
||||
SetPhaseMask(uint32(PHASEMASK_ANYWHERE), false); // see and visible in all phases
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, GetSession()->GetSecurity() == SEC_MODERATOR ? SEC_PLAYER : GetSession()->GetSecurity());
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, GetSession()->GetSecurity());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,7 +1034,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
|
||||
}
|
||||
|
||||
// friend status
|
||||
if (GetSecurity() < SEC_GAMEMASTER) // pussywizard: only for non-gms
|
||||
if (AccountMgr::IsGMAccount(GetSecurity())) // pussywizard: only for non-gms
|
||||
sSocialMgr->SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUIDLow(), true);
|
||||
|
||||
// Place character in world (and load zone) before some object loading
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "WardenWin.h"
|
||||
#include "WardenMac.h"
|
||||
#include "SavingSystem.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -516,7 +517,7 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
}
|
||||
|
||||
//! Broadcast a logout message to the player's friends
|
||||
if (GetSecurity() < SEC_GAMEMASTER) // pussywizard: only for non-gms
|
||||
if (AccountMgr::IsGMAccount(GetSecurity())) // pussywizard: only for non-gms
|
||||
sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
|
||||
sSocialMgr->RemovePlayerSocial(_player->GetGUIDLow());
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
return false;
|
||||
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
if (!target || handler->GetSession()->GetSecurity() < SEC_GAMEMASTER)
|
||||
if (!target || AccountMgr::IsGMAccount(handler->GetSession()->GetSecurity()))
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
|
||||
WorldPacket data(12);
|
||||
|
||||
@@ -18,6 +18,7 @@ EndScriptData */
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
class modify_commandscript : public CommandScript
|
||||
{
|
||||
@@ -473,7 +474,7 @@ public:
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (handler->GetSession()->GetSecurity() < SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(handler->GetSession()->GetSecurity()))
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
if (!target)
|
||||
{
|
||||
@@ -523,7 +524,7 @@ public:
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (handler->GetSession()->GetSecurity() < SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(handler->GetSession()->GetSecurity()))
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
if (!target)
|
||||
{
|
||||
@@ -570,7 +571,7 @@ public:
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (handler->GetSession()->GetSecurity() < SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(handler->GetSession()->GetSecurity()))
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
if (!target)
|
||||
{
|
||||
@@ -617,7 +618,7 @@ public:
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (handler->GetSession()->GetSecurity() < SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(handler->GetSession()->GetSecurity()))
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
if (!target)
|
||||
{
|
||||
@@ -664,7 +665,7 @@ public:
|
||||
}
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
if (handler->GetSession()->GetSecurity() < SEC_GAMEMASTER)
|
||||
if (AccountMgr::IsGMAccount(handler->GetSession()->GetSecurity()))
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
if (!target)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user