[Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions)

This commit is contained in:
Spp
2011-09-15 14:12:57 +02:00
parent 9006e4e8dc
commit af05915b9e
431 changed files with 3131 additions and 3131 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ extern int main(int argc, char **argv)
{
sLog->SetLogDB(false);
// Command line parsing to get the configuration file name
char const *cfg_file = _TRINITY_REALM_CONFIG;
char const* cfg_file = _TRINITY_REALM_CONFIG;
int c = 1;
while(c < argc)
{
+1 -1
View File
@@ -78,7 +78,7 @@ void RealmList::UpdateRealms(bool init)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 realmId = fields[0].GetUInt32();
const std::string& name = fields[1].GetString();
const std::string& address = fields[2].GetString();
+4 -4
View File
@@ -147,11 +147,11 @@ typedef struct AuthHandler
class PatcherRunnable: public ACE_Based::Runnable
{
public:
PatcherRunnable(class AuthSocket *);
PatcherRunnable(class AuthSocket* );
void run();
private:
AuthSocket * mySocket;
AuthSocket* mySocket;
};
typedef struct PATCH_INFO
@@ -948,7 +948,7 @@ bool AuthSocket::_HandleXferAccept()
return true;
}
PatcherRunnable::PatcherRunnable(class AuthSocket * as)
PatcherRunnable::PatcherRunnable(class AuthSocket* as)
{
mySocket = as;
}
@@ -1016,7 +1016,7 @@ void Patcher::LoadPatchMD5(char *szFileName)
// Try to open the patch file
std::string path = "./patches/";
path += szFileName;
FILE *pPatch = fopen(path.c_str(), "rb");
FILE* pPatch = fopen(path.c_str(), "rb");
sLog->outDebug(LOG_FILTER_NETWORKIO, "Loading patch info from %s\n", path.c_str());
if (!pPatch)
+1 -1
View File
@@ -62,7 +62,7 @@ public:
void _SetVSFields(const std::string& rI);
FILE *pPatch;
FILE* pPatch;
ACE_Thread_Mutex patcherLock;
private:
+1 -1
View File
@@ -36,7 +36,7 @@ public:
}
protected:
virtual int make_svc_handler(RealmSocket *&sh)
virtual int make_svc_handler(RealmSocket* &sh)
{
if (sh == 0)
ACE_NEW_RETURN(sh, RealmSocket, -1);
+2 -2
View File
@@ -177,7 +177,7 @@ bool RealmSocket::send(const char *buf, size_t len)
message_block.rd_ptr(un);
}
ACE_Message_Block *mb = message_block.clone();
ACE_Message_Block* mb = message_block.clone();
if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value *)(&ACE_Time_Value::zero)) == -1)
{
@@ -196,7 +196,7 @@ int RealmSocket::handle_output(ACE_HANDLE)
if (closing_)
return -1;
ACE_Message_Block *mb = 0;
ACE_Message_Block* mb = 0;
if (msg_queue()->is_empty())
{
+1 -1
View File
@@ -69,7 +69,7 @@ private:
ssize_t noblk_send(ACE_Message_Block &message_block);
ACE_Message_Block input_buffer_;
Session *session_;
Session* session_;
std::string remote_address_;
};
@@ -238,7 +238,7 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat
stats.updateLeaf(depth + 1, 0);
}
bool BIH::writeToFile(FILE *wf) const
bool BIH::writeToFile(FILE* wf) const
{
uint32 treeSize = tree.size();
uint32 check=0, count=0;
@@ -252,7 +252,7 @@ bool BIH::writeToFile(FILE *wf) const
return check == (3 + 3 + 2 + treeSize + count);
}
bool BIH::readFromFile(FILE *rf)
bool BIH::readFromFile(FILE* rf)
{
uint32 treeSize;
Vector3 lo, hi;
@@ -334,8 +334,8 @@ class BIH
}
}
bool writeToFile(FILE *wf) const;
bool readFromFile(FILE *rf);
bool writeToFile(FILE* wf) const;
bool readFromFile(FILE* rf);
protected:
std::vector<uint32> tree;
@@ -53,7 +53,7 @@ namespace VMAP
}
}
IVMapManager *gVMapManager = 0;
IVMapManager* gVMapManager = 0;
Table<unsigned int , bool>* iIgnoreSpellIds=0;
//===============================================
+14 -14
View File
@@ -41,7 +41,7 @@ namespace VMAP
class MapRayCallback
{
public:
MapRayCallback(ModelInstance *val): prims(val), hit(false) {}
MapRayCallback(ModelInstance* val): prims(val), hit(false) {}
bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool pStopAtFirstHit=true)
{
bool result = prims[entry].intersectRay(ray, distance, pStopAtFirstHit);
@@ -51,14 +51,14 @@ namespace VMAP
}
bool didHit() { return hit; }
protected:
ModelInstance *prims;
ModelInstance* prims;
bool hit;
};
class AreaInfoCallback
{
public:
AreaInfoCallback(ModelInstance *val): prims(val) {}
AreaInfoCallback(ModelInstance* val): prims(val) {}
void operator()(const Vector3& point, uint32 entry)
{
#ifdef VMAP_DEBUG
@@ -67,14 +67,14 @@ namespace VMAP
prims[entry].intersectPoint(point, aInfo);
}
ModelInstance *prims;
ModelInstance* prims;
AreaInfo aInfo;
};
class LocationInfoCallback
{
public:
LocationInfoCallback(ModelInstance *val, LocationInfo &info): prims(val), locInfo(info), result(false) {}
LocationInfoCallback(ModelInstance* val, LocationInfo &info): prims(val), locInfo(info), result(false) {}
void operator()(const Vector3& point, uint32 entry)
{
#ifdef VMAP_DEBUG
@@ -84,7 +84,7 @@ namespace VMAP
result = true;
}
ModelInstance *prims;
ModelInstance* prims;
LocationInfo &locInfo;
bool result;
};
@@ -245,7 +245,7 @@ namespace VMAP
basePath.push_back('/');
std::string fullname = basePath + VMapManager2::getMapFileName(mapID);
bool success = true;
FILE *rf = fopen(fullname.c_str(), "rb");
FILE* rf = fopen(fullname.c_str(), "rb");
if (!rf)
return false;
// TODO: check magic number when implemented...
@@ -275,12 +275,12 @@ namespace VMAP
//=========================================================
bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm)
bool StaticMapTree::InitMap(const std::string &fname, VMapManager2* vm)
{
sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str());
bool success = true;
std::string fullname = iBasePath + fname;
FILE *rf = fopen(fullname.c_str(), "rb");
FILE* rf = fopen(fullname.c_str(), "rb");
if (!rf)
return false;
else
@@ -309,7 +309,7 @@ namespace VMAP
#endif
if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
{
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str());
if (model)
{
@@ -331,7 +331,7 @@ namespace VMAP
//=========================================================
void StaticMapTree::UnloadMap(VMapManager2 *vm)
void StaticMapTree::UnloadMap(VMapManager2* vm)
{
for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
{
@@ -345,7 +345,7 @@ namespace VMAP
//=========================================================
bool StaticMapTree::LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm)
bool StaticMapTree::LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm)
{
if (!iIsTiled)
{
@@ -380,7 +380,7 @@ namespace VMAP
if (result)
{
// acquire model instance
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
if (!model)
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
@@ -426,7 +426,7 @@ namespace VMAP
//=========================================================
void StaticMapTree::UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm)
void StaticMapTree::UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm)
{
uint32 tileID = packTileID(tileX, tileY);
loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
+7 -7
View File
@@ -32,8 +32,8 @@ namespace VMAP
struct LocationInfo
{
LocationInfo(): hitInstance(0), hitModel(0), ground_Z(-G3D::inf()) {};
const ModelInstance *hitInstance;
const GroupModel *hitModel;
const ModelInstance* hitInstance;
const GroupModel* hitModel;
float ground_Z;
};
@@ -45,7 +45,7 @@ namespace VMAP
uint32 iMapID;
bool iIsTiled;
BIH iTree;
ModelInstance *iTreeValues; // the tree entries
ModelInstance* iTreeValues; // the tree entries
uint32 iNTreeValues;
// Store all the map tile idents that are loaded for that map
@@ -74,10 +74,10 @@ namespace VMAP
bool getAreaInfo(G3D::Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const;
bool GetLocationInfo(const Vector3 &pos, LocationInfo &info) const;
bool InitMap(const std::string &fname, VMapManager2 *vm);
void UnloadMap(VMapManager2 *vm);
bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm);
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2 *vm);
bool InitMap(const std::string &fname, VMapManager2* vm);
void UnloadMap(VMapManager2* vm);
bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
bool isTiled() const { return iIsTiled; }
uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
};
+7 -7
View File
@@ -39,7 +39,7 @@ template<> struct BoundsTrait<VMAP::ModelSpawn*>
namespace VMAP
{
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len)
bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len)
{
if (fread(dest, sizeof(char), len, rf) != len) return false;
return memcmp(dest, compare, len) == 0;
@@ -113,7 +113,7 @@ namespace VMAP
// write map tree file
std::stringstream mapfilename;
mapfilename << iDestDir << '/' << std::setfill('0') << std::setw(3) << map_iter->first << ".vmtree";
FILE *mapfile = fopen(mapfilename.str().c_str(), "wb");
FILE* mapfile = fopen(mapfilename.str().c_str(), "wb");
if (!mapfile)
{
success = false;
@@ -157,7 +157,7 @@ namespace VMAP
uint32 x, y;
StaticMapTree::unpackTileID(tile->first, x, y);
tilefilename << std::setw(2) << x << '_' << std::setw(2) << y << ".vmtile";
FILE *tilefile = fopen(tilefilename.str().c_str(), "wb");
FILE* tilefile = fopen(tilefilename.str().c_str(), "wb");
// file header
if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false;
// write number of tile spawns
@@ -202,7 +202,7 @@ namespace VMAP
bool TileAssembler::readMapSpawns()
{
std::string fname = iSrcDir + "/dir_bin";
FILE *dirf = fopen(fname.c_str(), "rb");
FILE* dirf = fopen(fname.c_str(), "rb");
if (!dirf)
{
printf("Could not read dir_bin file!\n");
@@ -251,7 +251,7 @@ namespace VMAP
modelPosition.iScale = spawn.iScale;
modelPosition.init();
FILE *rf = fopen(modelFilename.c_str(), "rb");
FILE* rf = fopen(modelFilename.c_str(), "rb");
if (!rf)
{
printf("ERROR: Can't open model file: %s\n", modelFilename.c_str());
@@ -363,7 +363,7 @@ namespace VMAP
if (filename.length() >0)
filename.push_back('/');
filename.append(pModelFilename);
FILE *rf = fopen(filename.c_str(), "rb");
FILE* rf = fopen(filename.c_str(), "rb");
if (!rf)
{
@@ -466,7 +466,7 @@ namespace VMAP
delete[] vectorarray;
}
// ----- liquid
WmoLiquid *liquid = 0;
WmoLiquid* liquid = 0;
if (liquidflags& 1)
{
WMOLiquidHeader hlq;
@@ -26,7 +26,7 @@ using G3D::Ray;
namespace VMAP
{
ModelInstance::ModelInstance(const ModelSpawn &spawn, WorldModel *model): ModelSpawn(spawn), iModel(model)
ModelInstance::ModelInstance(const ModelSpawn &spawn, WorldModel* model): ModelSpawn(spawn), iModel(model)
{
iInvRot = G3D::Matrix3::fromEulerAnglesZYX(G3D::pi()*iRot.y/180.f, G3D::pi()*iRot.x/180.f, G3D::pi()*iRot.z/180.f).inverse();
iInvScale = 1.f/iScale;
@@ -151,7 +151,7 @@ namespace VMAP
return false;
}
bool ModelSpawn::readFromFile(FILE *rf, ModelSpawn &spawn)
bool ModelSpawn::readFromFile(FILE* rf, ModelSpawn &spawn)
{
uint32 check = 0, nameLen;
check += fread(&spawn.flags, sizeof(uint32), 1, rf);
@@ -197,7 +197,7 @@ namespace VMAP
return true;
}
bool ModelSpawn::writeToFile(FILE *wf, const ModelSpawn &spawn)
bool ModelSpawn::writeToFile(FILE* wf, const ModelSpawn &spawn)
{
uint32 check=0;
check += fwrite(&spawn.flags, sizeof(uint32), 1, wf);
+4 -4
View File
@@ -56,15 +56,15 @@ namespace VMAP
// temp?
const G3D::AABox& getBounds() const { return iBound; }
static bool readFromFile(FILE *rf, ModelSpawn &spawn);
static bool writeToFile(FILE *rw, const ModelSpawn &spawn);
static bool readFromFile(FILE* rf, ModelSpawn &spawn);
static bool writeToFile(FILE* rw, const ModelSpawn &spawn);
};
class ModelInstance: public ModelSpawn
{
public:
ModelInstance(): iModel(0) {}
ModelInstance(const ModelSpawn &spawn, WorldModel *model);
ModelInstance(const ModelSpawn &spawn, WorldModel* model);
void setUnloaded() { iModel = 0; }
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const;
void intersectPoint(const G3D::Vector3& p, AreaInfo &info) const;
@@ -73,7 +73,7 @@ namespace VMAP
protected:
G3D::Matrix3 iInvRot;
float iInvScale;
WorldModel *iModel;
WorldModel* iModel;
};
} // namespace VMAP
+7 -7
View File
@@ -202,7 +202,7 @@ namespace VMAP
iTilesX * iTilesY;
}
bool WmoLiquid::writeToFile(FILE *wf)
bool WmoLiquid::writeToFile(FILE* wf)
{
bool result = true;
if (result && fwrite(&iTilesX, sizeof(uint32), 1, wf) != 1) result = false;
@@ -216,10 +216,10 @@ namespace VMAP
return result;
}
bool WmoLiquid::readFromFile(FILE *rf, WmoLiquid *&out)
bool WmoLiquid::readFromFile(FILE* rf, WmoLiquid* &out)
{
bool result = true;
WmoLiquid *liquid = new WmoLiquid();
WmoLiquid* liquid = new WmoLiquid();
if (result && fread(&liquid->iTilesX, sizeof(uint32), 1, rf) != 1) result = false;
if (result && fread(&liquid->iTilesY, sizeof(uint32), 1, rf) != 1) result = false;
if (result && fread(&liquid->iCorner, sizeof(Vector3), 1, rf) != 1) result = false;
@@ -254,7 +254,7 @@ namespace VMAP
meshTree.build(triangles, bFunc);
}
bool GroupModel::writeToFile(FILE *wf)
bool GroupModel::writeToFile(FILE* wf)
{
bool result = true;
uint32 chunkSize, count;
@@ -300,7 +300,7 @@ namespace VMAP
return result;
}
bool GroupModel::readFromFile(FILE *rf)
bool GroupModel::readFromFile(FILE* rf)
{
char chunk[8];
bool result = true;
@@ -501,7 +501,7 @@ namespace VMAP
bool WorldModel::writeFile(const std::string &filename)
{
FILE *wf = fopen(filename.c_str(), "wb");
FILE* wf = fopen(filename.c_str(), "wb");
if (!wf)
return false;
@@ -535,7 +535,7 @@ namespace VMAP
bool WorldModel::readFile(const std::string &filename)
{
FILE *rf = fopen(filename.c_str(), "rb");
FILE* rf = fopen(filename.c_str(), "rb");
if (!rf)
return false;
+6 -6
View File
@@ -56,8 +56,8 @@ namespace VMAP
float *GetHeightStorage() { return iHeight; }
uint8 *GetFlagsStorage() { return iFlags; }
uint32 GetFileSize();
bool writeToFile(FILE *wf);
static bool readFromFile(FILE *rf, WmoLiquid *&liquid);
bool writeToFile(FILE* wf);
static bool readFromFile(FILE* rf, WmoLiquid* &liquid);
private:
WmoLiquid(): iHeight(0), iFlags(0) {};
uint32 iTilesX; //!< number of tiles in x direction, each
@@ -80,13 +80,13 @@ namespace VMAP
//! pass mesh data to object and create BIH. Passed vectors get get swapped with old geometry!
void setMeshData(std::vector<Vector3> &vert, std::vector<MeshTriangle> &tri);
void setLiquidData(WmoLiquid *liquid) { iLiquid = liquid; }
void setLiquidData(WmoLiquid* liquid) { iLiquid = liquid; }
bool IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const;
bool IsInsideObject(const Vector3 &pos, const Vector3 &down, float &z_dist) const;
bool GetLiquidLevel(const Vector3 &pos, float &liqHeight) const;
uint32 GetLiquidType() const;
bool writeToFile(FILE *wf);
bool readFromFile(FILE *rf);
bool writeToFile(FILE* wf);
bool readFromFile(FILE* rf);
const G3D::AABox& GetBound() const { return iBound; }
uint32 GetMogpFlags() const { return iMogpFlags; }
uint32 GetWmoID() const { return iGroupWMOID; }
@@ -97,7 +97,7 @@ namespace VMAP
std::vector<Vector3> vertices;
std::vector<MeshTriangle> triangles;
BIH meshTree;
WmoLiquid *iLiquid;
WmoLiquid* iLiquid;
};
/*! Holds a model (converted M2 or WMO) in its original coordinate space */
class WorldModel
+1 -1
View File
@@ -27,6 +27,6 @@ namespace VMAP
const char VMAP_MAGIC[] = "VMAP_3.0";
// defined in TileAssembler.cpp currently...
bool readChunk(FILE *rf, char *dest, const char *compare, uint32 len);
bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len);
}
#endif
+1 -1
View File
@@ -18,7 +18,7 @@
#include "GameObjectAI.h"
//GameObjectAI::GameObjectAI(GameObject *g) : go(g) {}
//GameObjectAI::GameObjectAI(GameObject* g) : go(g) {}
int GameObjectAI::Permissible(const GameObject* go)
{
if (go->GetAIName() == "GameObjectAI")
+1 -1
View File
@@ -259,7 +259,7 @@ void PetAI::UpdateAllies()
m_AllySet.insert(me->GetGUID());
if (group) //add group
{
for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
if (!Target || !group->SameSubGroup((Player*)owner, Target))
+1 -1
View File
@@ -42,7 +42,7 @@ void UnitAI::DoMeleeAttackIfReady()
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
Unit *victim = me->getVictim();
Unit* victim = me->getVictim();
//Make sure our attack is ready and we aren't currently casting before checking distance
if (me->isAttackReady() && me->IsWithinMeleeRange(victim))
{
@@ -1017,7 +1017,7 @@ void CreatureEventAI::AttackStart(Unit* who)
}
}
void CreatureEventAI::MoveInLineOfSight(Unit *who)
void CreatureEventAI::MoveInLineOfSight(Unit* who)
{
if (me->getVictim())
return;
+1 -1
View File
@@ -96,7 +96,7 @@ class SmartAI : public CreatureAI
// Tell creature to attack and follow the victim
void AttackStart(Unit* who);
// Called if IsVisible(Unit *who) is true at each *who move, reaction at visibility zone enter
// Called if IsVisible(Unit* who) is true at each *who move, reaction at visibility zone enter
void MoveInLineOfSight(Unit* who);
// Called when hit by a spell
+14 -14
View File
@@ -377,7 +377,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
}
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM:
{
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(miscvalue1);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(miscvalue1);
if (!pProto)
return false;
return pProto->ItemLevel >= equipped_item.item_level && pProto->Quality >= equipped_item.item_quality;
@@ -443,9 +443,9 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
{
AchievementCriteriaEntry const *achievementCriteria = (*i);
AchievementCriteriaEntry const* achievementCriteria = (*i);
AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
if (!achievement)
continue;
@@ -744,8 +744,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
{
AchievementCriteriaEntry const *achievementCriteria = (*i);
AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
AchievementCriteriaEntry const* achievementCriteria = (*i);
AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
if (!achievement)
continue;
@@ -1281,7 +1281,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (miscValue2 != achievementCriteria->roll_greed_on_loot.rollValue)
continue;
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(miscValue1);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(miscValue1);
if (!pProto)
continue;
@@ -1928,7 +1928,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
SendCriteriaUpdate(entry, progress, timeElapsed, timedCompleted);
}
void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry *entry)
void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry)
{
CriteriaProgressMap::iterator criteriaProgress = m_criteriaProgress.find(entry->ID);
if (criteriaProgress == m_criteriaProgress.end())
@@ -1950,7 +1950,7 @@ void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff)
// Time is up, remove timer and reset progress
if (itr->second <= timeDiff)
{
AchievementCriteriaEntry const *entry = sAchievementCriteriaStore.LookupEntry(itr->first);
AchievementCriteriaEntry const* entry = sAchievementCriteriaStore.LookupEntry(itr->first);
RemoveCriteriaProgress(entry);
m_timedAchievements.erase(itr++);
}
@@ -1971,7 +1971,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u
if ((*i)->timerStartEvent != entry)
continue;
AchievementEntry const *achievement = sAchievementStore.LookupEntry((*i)->referredAchievement);
AchievementEntry const* achievement = sAchievementStore.LookupEntry((*i)->referredAchievement);
if (m_timedAchievements.find((*i)->ID) == m_timedAchievements.end() && !IsCompletedCriteria(*i, achievement))
{
// Start the timer
@@ -2097,7 +2097,7 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player) const
/**
* used by SMSG_RESPOND_INSPECT_ACHIEVEMENT and SMSG_ALL_ACHIEVEMENT_DATA
*/
void AchievementMgr::BuildAllDataPacket(WorldPacket *data) const
void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const
{
AchievementEntry const* achievement = NULL;
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)
@@ -2247,7 +2247,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 criteria_id = fields[0].GetUInt32();
AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(criteria_id);
@@ -2389,7 +2389,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 achievement_id = fields[0].GetUInt32();
if (!sAchievementStore.LookupEntry(achievement_id))
@@ -2427,7 +2427,7 @@ void AchievementGlobalMgr::LoadRewards()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
const AchievementEntry* pAchievement = sAchievementStore.LookupEntry(entry);
if (!pAchievement)
@@ -2533,7 +2533,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
@@ -274,7 +274,7 @@ class AchievementMgr
bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement);
bool IsCompletedAchievement(AchievementEntry const* entry);
bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement);
void BuildAllDataPacket(WorldPacket *data) const;
void BuildAllDataPacket(WorldPacket* data) const;
Player* m_player;
CriteriaProgressMap m_criteriaProgress;
@@ -324,7 +324,7 @@ class AchievementGlobalMgr
return iter != m_achievementRewardLocales.end() ? &iter->second : NULL;
}
AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const *achievementCriteria) const
AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const* achievementCriteria) const
{
AchievementCriteriaDataMap::const_iterator iter = m_criteriaDataMap.find(achievementCriteria->ID);
return iter != m_criteriaDataMap.end() ? &iter->second : NULL;
+1 -1
View File
@@ -52,7 +52,7 @@ void LoadFromDB()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
std::string name = fields[0].GetString();
uint32 crc = fields[1].GetUInt32();
@@ -47,7 +47,7 @@ AuctionHouseMgr::~AuctionHouseMgr()
delete itr->second;
}
AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
{
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
return &mNeutralAuctions;
@@ -64,7 +64,7 @@ AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
return &mNeutralAuctions;
}
uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem, uint32 count)
uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count)
{
uint32 MSV = pItem->GetTemplate()->SellPrice;
@@ -87,15 +87,15 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32
}
//does not clear ram
void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& trans)
void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans)
{
Item *pItem = GetAItem(auction->item_guidlow);
Item* pItem = GetAItem(auction->item_guidlow);
if (!pItem)
return;
uint32 bidder_accId = 0;
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *bidder = ObjectAccessor::FindPlayer(bidder_guid);
Player* bidder = ObjectAccessor::FindPlayer(bidder_guid);
// data for gm.log
if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
@@ -163,10 +163,10 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction&
}
}
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTransaction& trans)
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTransaction& trans)
{
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = ObjectAccessor::FindPlayer(owner_guid);
Player* owner = ObjectAccessor::FindPlayer(owner_guid);
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
// owner exist (online or offline)
if (owner || owner_accId)
@@ -193,10 +193,10 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran
}
//call this method to send mail to auction owner, when auction is successful, it does not clear ram
void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTransaction& trans)
void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransaction& trans)
{
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = ObjectAccessor::FindPlayer(owner_guid);
Player* owner = ObjectAccessor::FindPlayer(owner_guid);
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
// owner exist
if (owner || owner_accId)
@@ -231,15 +231,15 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans
}
//does not clear ram
void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransaction& trans)
void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans)
{
//return an item in auction to its owner by mail
Item *pItem = GetAItem(auction->item_guidlow);
Item* pItem = GetAItem(auction->item_guidlow);
if (!pItem)
return;
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
Player *owner = ObjectAccessor::FindPlayer(owner_guid);
Player* owner = ObjectAccessor::FindPlayer(owner_guid);
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
// owner exist
if (owner || owner_accId)
@@ -257,10 +257,10 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact
}
//this function sends mail to old bidder
void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans)
void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans)
{
uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *oldBidder = ObjectAccessor::FindPlayer(oldBidder_guid);
Player* oldBidder = ObjectAccessor::FindPlayer(oldBidder_guid);
uint32 oldBidder_accId = 0;
if (!oldBidder)
@@ -285,7 +285,7 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 new
void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans)
{
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *bidder = ObjectAccessor::FindPlayer(bidder_guid);
Player* bidder = ObjectAccessor::FindPlayer(bidder_guid);
uint32 bidder_accId = 0;
if (!bidder)
@@ -328,14 +328,14 @@ void AuctionHouseMgr::LoadAuctionItems()
uint32 item_guid = fields[11].GetUInt32();
uint32 item_template = fields[12].GetUInt32();
ItemTemplate const *proto = sObjectMgr->GetItemTemplate(item_template);
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item_template);
if (!proto)
{
sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template);
continue;
}
Item *item = NewItemOrBag(proto);
Item* item = NewItemOrBag(proto);
if (!item->LoadFromDB(item_guid, 0, fields, item_template))
{
delete item;
@@ -372,7 +372,7 @@ void AuctionHouseMgr::LoadAuctions()
{
Field* fields = result->Fetch();
AuctionEntry *aItem = new AuctionEntry();
AuctionEntry* aItem = new AuctionEntry();
if (!aItem->LoadFromDB(fields))
{
aItem->DeleteFromDB(trans);
@@ -454,7 +454,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
return sAuctionHouseStore.LookupEntry(houseid);
}
void AuctionHouseObject::AddAuction(AuctionEntry *auction)
void AuctionHouseObject::AddAuction(AuctionEntry* auction)
{
ASSERT(auction);
@@ -462,7 +462,7 @@ void AuctionHouseObject::AddAuction(AuctionEntry *auction)
sScriptMgr->OnAuctionAdd(this, auction);
}
bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 /*item_template*/)
bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*item_template*/)
{
bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false;
@@ -530,7 +530,7 @@ void AuctionHouseObject::BuildListBidderItems(WorldPacket& data, Player* player,
{
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
{
AuctionEntry *Aentry = itr->second;
AuctionEntry* Aentry = itr->second;
if (Aentry && Aentry->bidder == player->GetGUIDLow())
{
if (itr->second->BuildAuctionInfo(data))
@@ -545,7 +545,7 @@ void AuctionHouseObject::BuildListOwnerItems(WorldPacket& data, Player* player,
{
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
{
AuctionEntry *Aentry = itr->second;
AuctionEntry* Aentry = itr->second;
if (Aentry && Aentry->owner == player->GetGUIDLow())
{
if (Aentry->BuildAuctionInfo(data))
@@ -566,12 +566,12 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
{
AuctionEntry *Aentry = itr->second;
Item *item = sAuctionMgr->GetAItem(Aentry->item_guidlow);
AuctionEntry* Aentry = itr->second;
Item* item = sAuctionMgr->GetAItem(Aentry->item_guidlow);
if (!item)
continue;
ItemTemplate const *proto = item->GetTemplate();
ItemTemplate const* proto = item->GetTemplate();
if (itemClass != 0xffffffff && proto->Class != itemClass)
continue;
@@ -601,7 +601,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
// local name
if (loc_idx >= 0)
if (ItemLocale const *il = sObjectMgr->GetItemLocale(proto->ItemId))
if (ItemLocale const* il = sObjectMgr->GetItemLocale(proto->ItemId))
ObjectMgr::GetLocaleString(il->Name, loc_idx, name);
// DO NOT use GetItemEnchantMod(proto->RandomProperty) as it may return a result
@@ -614,7 +614,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
// Append the suffix to the name (ie: of the Monkey) if one exists
// These are found in ItemRandomProperties.dbc, not ItemRandomSuffix.dbc
// even though the DBC names seem misleading
const ItemRandomPropertiesEntry *itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID);
const ItemRandomPropertiesEntry* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID);
if (itemRandProp)
{
@@ -650,7 +650,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
//this function inserts to WorldPacket auction's data
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
{
Item *pItem = sAuctionMgr->GetAItem(item_guidlow);
Item* pItem = sAuctionMgr->GetAItem(item_guidlow);
if (!pItem)
{
sLog->outError("auction to item, that doesn't exist !!!!");
@@ -791,7 +791,7 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
{
Field* fields = expAuctions->Fetch();
AuctionEntry *auction = new AuctionEntry();
AuctionEntry* auction = new AuctionEntry();
// Can't use LoadFromDB() because it assumes the auction map is loaded
if (!auction->LoadFromFieldList(fields))
@@ -101,9 +101,9 @@ class AuctionHouseObject
return itr != AuctionsMap.end() ? itr->second : NULL;
}
void AddAuction(AuctionEntry *auction);
void AddAuction(AuctionEntry* auction);
bool RemoveAuction(AuctionEntry *auction, uint32 item_template);
bool RemoveAuction(AuctionEntry* auction, uint32 item_template);
void Update();
@@ -146,14 +146,14 @@ class AuctionHouseMgr
}
//auction messages
void SendAuctionWonMail(AuctionEntry * auction, SQLTransaction& trans);
void SendAuctionSalePendingMail(AuctionEntry * auction, SQLTransaction& trans);
void SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTransaction& trans);
void SendAuctionExpiredMail(AuctionEntry * auction, SQLTransaction& trans);
void SendAuctionOutbiddedMail(AuctionEntry * auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans);
void SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans);
void SendAuctionSalePendingMail(AuctionEntry* auction, SQLTransaction& trans);
void SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransaction& trans);
void SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans);
void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans);
void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans);
static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem, uint32 count);
static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count);
static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId);
public:
+2 -2
View File
@@ -194,7 +194,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult result)
if (!result)
return false;
Field *fields = result->Fetch();
Field* fields = result->Fetch();
TeamId = fields[0].GetUInt32();
TeamName = fields[1].GetString();
@@ -224,7 +224,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
// Prevent crash if db records are broken when all members in result are already processed and current team doesn't have any members
if (!fields)
@@ -148,7 +148,7 @@ void ArenaTeamMgr::DistributeArenaPoints()
// At first update all points for all team members
for (ArenaTeamContainer::iterator teamItr = GetArenaTeamMapBegin(); teamItr != GetArenaTeamMapEnd(); ++teamItr)
if (ArenaTeam * at = teamItr->second)
if (ArenaTeam* at = teamItr->second)
at->UpdateArenaPointsHelper(PlayerPoints);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
@@ -172,7 +172,7 @@ void ArenaTeamMgr::DistributeArenaPoints()
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
for (ArenaTeamContainer::iterator titr = GetArenaTeamMapBegin(); titr != GetArenaTeamMapEnd(); ++titr)
{
if (ArenaTeam * at = titr->second)
if (ArenaTeam* at = titr->second)
{
at->FinishWeek();
at->SaveToDB();
+25 -25
View File
@@ -124,7 +124,7 @@ template<class Do>
void Battleground::BroadcastWorker(Do& _do)
{
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
if (Player* plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
_do(plr);
}
@@ -325,10 +325,10 @@ inline void Battleground::_ProcessRessurect(uint32 diff)
{
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
{
Creature *sh = NULL;
Creature* sh = NULL;
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
{
Player *plr = ObjectAccessor::FindPlayer(*itr2);
Player* plr = ObjectAccessor::FindPlayer(*itr2);
if (!plr)
continue;
@@ -359,7 +359,7 @@ inline void Battleground::_ProcessRessurect(uint32 diff)
{
for (std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
{
Player *plr = ObjectAccessor::FindPlayer(*itr);
Player* plr = ObjectAccessor::FindPlayer(*itr);
if (!plr)
continue;
plr->ResurrectPlayer(1.0f);
@@ -424,7 +424,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
{
m_ResetStatTimer = 0;
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
plr->ResetAllPowers();
}
@@ -472,7 +472,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
{
// TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
{
// BG Status packet
WorldPacket status;
@@ -488,7 +488,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
for (Unit::AuraApplicationMap::iterator iter = auraMap.begin(); iter != auraMap.end();)
{
AuraApplication * aurApp = iter->second;
Aura * aura = aurApp->GetBase();
Aura* aura = aurApp->GetBase();
if (!aura->IsPermanent()
&& aura->GetDuration() <= 30*IN_MILLISECONDS
&& aurApp->IsPositive()
@@ -594,7 +594,7 @@ void Battleground::SendPacketToAll(WorldPacket* packet)
player->GetSession()->SendPacket(packet);
}
void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player *sender, bool self)
void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player* sender, bool self)
{
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* player = _GetPlayerForTeam(TeamID, itr, "SendPacketToTeam"))
@@ -963,8 +963,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{
//left a rated match while the encounter was in progress, consider as loser
ArenaTeam * winner_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * loser_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team));
ArenaTeam* winner_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam* loser_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
loser_arena_team->MemberLost(plr, GetArenaMatchmakerRating(GetOtherTeam(team)));
}
@@ -985,8 +985,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{
//left a rated match while the encounter was in progress, consider as loser
ArenaTeam * others_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam * players_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team));
ArenaTeam* others_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
ArenaTeam* players_arena_team = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team));
if (others_arena_team && players_arena_team)
players_arena_team->OfflineMemberLost(guid, GetArenaMatchmakerRating(GetOtherTeam(team)));
}
@@ -1373,7 +1373,7 @@ void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
{
m_ReviveQueue[npc_guid].push_back(player_guid);
Player *plr = ObjectAccessor::FindPlayer(player_guid);
Player* plr = ObjectAccessor::FindPlayer(player_guid);
if (!plr)
return;
@@ -1389,7 +1389,7 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid)
if (*itr2 == player_guid)
{
(itr->second).erase(itr2);
if (Player *plr = ObjectAccessor::FindPlayer(player_guid))
if (Player* plr = ObjectAccessor::FindPlayer(player_guid))
plr->RemoveAurasDueToSpell(SPELL_WAITING_FOR_RESURRECT);
return;
}
@@ -1402,7 +1402,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
// If the assert is called, means that m_BgObjects must be resized!
ASSERT(type < m_BgObjects.size());
Map *map = GetBgMap();
Map* map = GetBgMap();
if (!map)
return false;
// Must be created this way, adding to godatamap would add it to the base map of the instance
@@ -1451,7 +1451,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
// It would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code
void Battleground::DoorClose(uint32 type)
{
if (GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]))
if (GameObject* obj = GetBgMap()->GetGameObject(m_BgObjects[type]))
{
// If doors are open, close it
if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY)
@@ -1468,7 +1468,7 @@ void Battleground::DoorClose(uint32 type)
void Battleground::DoorOpen(uint32 type)
{
if (GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]))
if (GameObject* obj = GetBgMap()->GetGameObject(m_BgObjects[type]))
{
// Change state to be sure they will be opened
obj->SetLootState(GO_READY);
@@ -1481,7 +1481,7 @@ void Battleground::DoorOpen(uint32 type)
GameObject* Battleground::GetBGObject(uint32 type)
{
GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]);
GameObject* obj = GetBgMap()->GetGameObject(m_BgObjects[type]);
if (!obj)
sLog->outError("Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(m_BgObjects[type]), m_MapId, m_InstanceID);
@@ -1490,7 +1490,7 @@ GameObject* Battleground::GetBGObject(uint32 type)
Creature* Battleground::GetBGCreature(uint32 type)
{
Creature *creature = GetBgMap()->GetCreature(m_BgCreatures[type]);
Creature* creature = GetBgMap()->GetCreature(m_BgCreatures[type]);
if (!creature)
sLog->outError("Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(m_BgCreatures[type]), m_MapId, m_InstanceID);
@@ -1500,7 +1500,7 @@ Creature* Battleground::GetBGCreature(uint32 type)
void Battleground::SpawnBGObject(uint32 type, uint32 respawntime)
{
if (Map* map = GetBgMap())
if (GameObject *obj = map->GetGameObject(m_BgObjects[type]))
if (GameObject* obj = map->GetGameObject(m_BgObjects[type]))
{
if (respawntime)
obj->SetLootState(GO_JUST_DEACTIVATED);
@@ -1533,7 +1533,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
pCreature->SetHomePosition(x, y, z, o);
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(entry);
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cinfo)
{
sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
@@ -1559,7 +1559,7 @@ bool Battleground::DelCreature(uint32 type)
if (!m_BgCreatures[type])
return true;
if (Creature *creature = GetBgMap()->GetCreature(m_BgCreatures[type]))
if (Creature* creature = GetBgMap()->GetCreature(m_BgCreatures[type]))
{
creature->AddObjectToRemoveList();
m_BgCreatures[type] = 0;
@@ -1668,7 +1668,7 @@ void Battleground::SendWarningToAll(int32 entry, ...)
data << msg.c_str();
data << (uint8)0;
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
if (Player* plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
if (plr->GetSession())
plr->GetSession()->SendPacket(&data);
}
@@ -1699,7 +1699,7 @@ const char* Battleground::GetTrinityString(int32 entry)
// buffs are in their positions when battleground starts
void Battleground::HandleTriggerBuff(uint64 go_guid)
{
GameObject *obj = GetBgMap()->GetGameObject(go_guid);
GameObject* obj = GetBgMap()->GetGameObject(go_guid);
if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned())
return;
@@ -1857,7 +1857,7 @@ void Battleground::UpdateArenaWorldState()
UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));
}
void Battleground::SetBgRaid(uint32 TeamID, Group *bg_raid)
void Battleground::SetBgRaid(uint32 TeamID, Group* bg_raid)
{
Group*& old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
if (old_raid)
+5 -5
View File
@@ -476,10 +476,10 @@ class Battleground
void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0);
// Raid Group
Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
void SetBgRaid(uint32 TeamID, Group *bg_raid);
Group* GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
void SetBgRaid(uint32 TeamID, Group* bg_raid);
virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
virtual void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
static BattlegroundTeamId GetTeamIndexByTeamId(uint32 Team) { return Team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE; }
uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; }
@@ -630,7 +630,7 @@ class Battleground
bool m_IsRated; // is this battle rated?
bool m_PrematureCountDown;
uint32 m_PrematureCountDownTimer;
char const *m_Name;
char const* m_Name;
/* Pre- and post-update hooks */
@@ -673,7 +673,7 @@ class Battleground
uint32 m_InvitedHorde;
// Raid Group
Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde
Group* m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde
// Players count by team
uint32 m_PlayersCount[BG_TEAMS_COUNT];
@@ -174,7 +174,7 @@ void BattlegroundMgr::Update(uint32 diff)
}
}
void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame)
void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame)
{
// we can be in 2 queues in same time...
@@ -227,7 +227,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
}
}
void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
{
uint8 type = (bg->isArena() ? 1 : 0);
// last check on 3.0.3
@@ -291,7 +291,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
}
else
{
Player *plr = ObjectAccessor::FindPlayer(itr2->first);
Player* plr = ObjectAccessor::FindPlayer(itr2->first);
uint32 team = bg->GetPlayerTeam(itr2->first);
if (!team && plr)
team = plr->GetBGTeam();
@@ -396,7 +396,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
data->put(wpos, scoreCount);
}
void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket *data, GroupJoinBattlegroundResult result)
void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, GroupJoinBattlegroundResult result)
{
data->Initialize(SMSG_GROUP_JOINED_BATTLEGROUND, 4);
*data << int32(result);
@@ -404,26 +404,26 @@ void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket *data, Grou
*data << uint64(0); // player guid
}
void BattlegroundMgr::BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value)
void BattlegroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value)
{
data->Initialize(SMSG_UPDATE_WORLD_STATE, 4+4);
*data << uint32(field);
*data << uint32(value);
}
void BattlegroundMgr::BuildPlaySoundPacket(WorldPacket *data, uint32 soundid)
void BattlegroundMgr::BuildPlaySoundPacket(WorldPacket* data, uint32 soundid)
{
data->Initialize(SMSG_PLAY_SOUND, 4);
*data << uint32(soundid);
}
void BattlegroundMgr::BuildPlayerLeftBattlegroundPacket(WorldPacket *data, uint64 guid)
void BattlegroundMgr::BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid)
{
data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8);
*data << uint64(guid);
}
void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket *data, Player *plr)
void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Player* plr)
{
data->Initialize(SMSG_BATTLEGROUND_PLAYER_JOINED, 8);
*data << uint64(plr->GetGUID());
@@ -500,8 +500,8 @@ uint32 BattlegroundMgr::CreateClientVisibleInstanceId(BattlegroundTypeId bgTypeI
Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 arenaType, bool isRated)
{
// get the template BG
Battleground *bg_template = GetBattlegroundTemplate(bgTypeId);
BattlegroundSelectionWeightMap *selectionWeights = NULL;
Battleground* bg_template = GetBattlegroundTemplate(bgTypeId);
BattlegroundSelectionWeightMap* selectionWeights = NULL;
if (!bg_template)
{
@@ -552,7 +552,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
}
}
Battleground *bg = NULL;
Battleground* bg = NULL;
// create a copy of the BG template
switch(bgTypeId)
{
@@ -625,7 +625,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
uint32 BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data)
{
// Create the BG
Battleground *bg = NULL;
Battleground* bg = NULL;
switch (data.bgTypeId)
{
case BATTLEGROUND_AV: bg = new BattlegroundAV; break;
@@ -652,8 +652,8 @@ uint32 BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data)
bg->SetArenaorBGType(data.IsArena);
bg->SetMinPlayersPerTeam(data.MinPlayersPerTeam);
bg->SetMaxPlayersPerTeam(data.MaxPlayersPerTeam);
bg->SetMinPlayers(data.MinPlayersPerTeam * 2);
bg->SetMaxPlayers(data.MaxPlayersPerTeam * 2);
bg->SetMinPlayers(data.MinPlayersPerTeam* 2);
bg->SetMaxPlayers(data.MaxPlayersPerTeam* 2);
bg->SetName(data.BattlegroundName);
bg->SetTeamStartLoc(ALLIANCE, data.Team1StartLocX, data.Team1StartLocY, data.Team1StartLocZ, data.Team1StartLocO);
bg->SetTeamStartLoc(HORDE, data.Team2StartLocX, data.Team2StartLocY, data.Team2StartLocZ, data.Team2StartLocO);
@@ -672,7 +672,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
uint32 oldMSTime = getMSTime();
uint8 selectionWeight;
BattlemasterListEntry const *bl;
BattlemasterListEntry const* bl;
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, Weight, ScriptName FROM battleground_template");
@@ -688,7 +688,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 bgTypeID_ = fields[0].GetUInt32();
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeID_, NULL))
@@ -805,7 +805,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Automatic Arena Point Distribution initialized.");
}
void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, uint64 guid, Player* plr, BattlegroundTypeId bgTypeId, uint8 fromWhere)
void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* plr, BattlegroundTypeId bgTypeId, uint8 fromWhere)
{
if (!plr)
return;
@@ -869,9 +869,9 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, uint64 guid
}
}
void BattlegroundMgr::SendToBattleground(Player *pl, uint32 instanceId, BattlegroundTypeId bgTypeId)
void BattlegroundMgr::SendToBattleground(Player* pl, uint32 instanceId, BattlegroundTypeId bgTypeId)
{
Battleground *bg = GetBattleground(instanceId, bgTypeId);
Battleground* bg = GetBattleground(instanceId, bgTypeId);
if (bg)
{
uint32 mapid = bg->GetMapId();
@@ -890,7 +890,7 @@ void BattlegroundMgr::SendToBattleground(Player *pl, uint32 instanceId, Battlegr
}
}
void BattlegroundMgr::SendAreaSpiritHealerQueryOpcode(Player *pl, Battleground *bg, uint64 guid)
void BattlegroundMgr::SendAreaSpiritHealerQueryOpcode(Player* pl, Battleground* bg, uint64 guid)
{
WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 12);
uint32 time_ = 30000 - bg->GetLastResurrectTime(); // resurrect every 30 seconds
@@ -1080,7 +1080,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
{
++count;
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
uint32 bgTypeId = fields[1].GetUInt32();
+10 -10
View File
@@ -65,15 +65,15 @@ class BattlegroundMgr
void Update(uint32 diff);
/* Packet Building */
void BuildPlayerJoinedBattlegroundPacket(WorldPacket *data, Player *plr);
void BuildPlayerLeftBattlegroundPacket(WorldPacket *data, uint64 guid);
void BuildBattlegroundListPacket(WorldPacket *data, uint64 guid, Player *plr, BattlegroundTypeId bgTypeId, uint8 fromWhere);
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, GroupJoinBattlegroundResult result);
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
void BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg);
void BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame = 1);
void BuildPlaySoundPacket(WorldPacket *data, uint32 soundid);
void SendAreaSpiritHealerQueryOpcode(Player *pl, Battleground *bg, uint64 guid);
void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Player* plr);
void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid);
void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* plr, BattlegroundTypeId bgTypeId, uint8 fromWhere);
void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, GroupJoinBattlegroundResult result);
void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value);
void BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg);
void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame = 1);
void BuildPlaySoundPacket(WorldPacket* data, uint32 soundid);
void SendAreaSpiritHealerQueryOpcode(Player* pl, Battleground* bg, uint64 guid);
/* Battlegrounds */
Battleground* GetBattlegroundThroughClientInstance(uint32 instanceId, BattlegroundTypeId bgTypeId);
@@ -91,7 +91,7 @@ class BattlegroundMgr
void CreateInitialBattlegrounds();
void DeleteAllBattlegrounds();
void SendToBattleground(Player *pl, uint32 InstanceID, BattlegroundTypeId bgTypeId);
void SendToBattleground(Player* pl, uint32 InstanceID, BattlegroundTypeId bgTypeId);
/* Battleground queues */
//these queues are instantiated when creating BattlegroundMrg
@@ -105,7 +105,7 @@ bool BattlegroundQueue::SelectionPool::KickGroup(uint32 size)
// used when building selection pools
// returns true if we can invite more players, or when we added group to selection pool
// returns false when selection pool is full
bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount)
bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 desiredCount)
{
//if group is larger than desired count - don't allow to add it to pool
if (!ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size())
@@ -125,7 +125,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 de
/*********************************************************/
// add group or player (grp == NULL) to bg queue with the given leader and bg specifications
GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid)
GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid)
{
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
@@ -159,7 +159,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
//announce world (this don't need mutex)
if (isRated && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
{
ArenaTeam *Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
if (Team)
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
@@ -169,9 +169,9 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
//ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
if (grp)
{
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *member = itr->getSource();
Player* member = itr->getSource();
if (!member)
continue; // this should never happen
PlayerQueueInfo& pl_info = m_QueuedPlayers[member->GetGUID()];
@@ -283,7 +283,7 @@ uint32 BattlegroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, Battleg
//remove player from queue and from group info, if group info is empty then remove it too
void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
{
//Player *plr = ObjectAccessor::FindPlayer(guid);
//Player* plr = ObjectAccessor::FindPlayer(guid);
int32 bracket_id = -1; // signed for proper for-loop finish
QueuedPlayersMap::iterator itr;
@@ -351,16 +351,16 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
// announce to world if arena team left queue for rated match, show only once
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
if (ArenaTeam *Team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
if (ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
// if player leaves queue and he is invited to rated arena match, then he have to lose
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
{
if (ArenaTeam * at = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
if (Player *plr = ObjectAccessor::FindPlayer(guid))
if (Player* plr = ObjectAccessor::FindPlayer(guid))
at->MemberLost(plr, group->OpponentsMatchmakerRating);
else
at->OfflineMemberLost(guid, group->OpponentsMatchmakerRating);
@@ -381,7 +381,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
{
// remove next player, this is recursive
// first send removal information
if (Player *plr2 = ObjectAccessor::FindPlayer(group->Players.begin()->first))
if (Player* plr2 = ObjectAccessor::FindPlayer(group->Players.begin()->first))
{
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(group->BgTypeId);
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType);
@@ -415,7 +415,7 @@ bool BattlegroundQueue::GetPlayerGroupInfoData(uint64 guid, GroupQueueInfo* ginf
return true;
}
bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground* bg, uint32 side)
bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, uint32 side)
{
// set side if needed
if (side)
@@ -33,7 +33,7 @@ struct GroupQueueInfo; // type predefinitio
struct PlayerQueueInfo // stores information for players in queue
{
uint32 LastOnlineTime; // for tracking and removing offline players from queue after 5 minutes
GroupQueueInfo * GroupInfo; // pointer to the associated groupqueueinfo
GroupQueueInfo* GroupInfo; // pointer to the associated groupqueueinfo
};
struct GroupQueueInfo // stores information about the group in queue (also used when joined as solo!)
@@ -75,7 +75,7 @@ class BattlegroundQueue
bool CheckPremadeMatch(BattlegroundBracketId bracket_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam);
bool CheckNormalMatch(Battleground* bg_template, BattlegroundBracketId bracket_id, uint32 minPlayers, uint32 maxPlayers);
bool CheckSkirmishForSameFaction(BattlegroundBracketId bracket_id, uint32 minPlayersPerTeam);
GroupQueueInfo * AddGroup(Player* leader, Group* group, BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 ArenaTeamId = 0);
GroupQueueInfo* AddGroup(Player* leader, Group* group, BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 ArenaTeamId = 0);
void RemovePlayer(uint64 guid, bool decreaseInvitedCount);
bool IsPlayerInvited(uint64 pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime);
bool GetPlayerGroupInfoData(uint64 guid, GroupQueueInfo* ginfo);
@@ -104,7 +104,7 @@ class BattlegroundQueue
{
public:
void Init();
bool AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount);
bool AddGroup(GroupQueueInfo* ginfo, uint32 desiredCount);
bool KickGroup(uint32 size);
uint32 GetPlayerCount() const {return PlayerCount;}
public:
@@ -118,7 +118,7 @@ class BattlegroundQueue
private:
bool InviteGroupToBG(GroupQueueInfo * ginfo, Battleground* bg, uint32 side);
bool InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, uint32 side);
uint32 m_WaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME];
uint32 m_WaitTimeLastPlayer[BG_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS];
uint32 m_SumOfWaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS];
@@ -47,7 +47,7 @@ void BattlegroundAA::StartingEventOpenDoors()
{
}
void BattlegroundAA::AddPlayer(Player *plr)
void BattlegroundAA::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -35,12 +35,12 @@ class BattlegroundAA : public Battleground
~BattlegroundAA();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
void HandleKillPlayer(Player* player, Player* killer);
};
@@ -204,7 +204,7 @@ void BattlegroundAB::StartingEventOpenDoors()
DoorOpen(BG_AB_OBJECT_GATE_H);
}
void BattlegroundAB::AddPlayer(Player *plr)
void BattlegroundAB::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in the constructor
@@ -218,7 +218,7 @@ void BattlegroundAB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*tea
}
void BattlegroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundAB::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -406,7 +406,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node)
std::vector<uint64> ghost_list = m_ReviveQueue[m_BgCreatures[node]];
if (!ghost_list.empty())
{
WorldSafeLocsEntry const *ClosestGrave = NULL;
WorldSafeLocsEntry const* ClosestGrave = NULL;
for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
{
Player* plr = ObjectAccessor::FindPlayer(*itr);
@@ -428,7 +428,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node)
}
/* Invoked if a player used a banner as a gameobject */
void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/)
void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*target_obj*/)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -679,7 +679,7 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveYard(Player* player)
return good_entry;
}
void BattlegroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
void BattlegroundAB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
{
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
if (itr == m_PlayerScores.end()) // player not found...
@@ -245,23 +245,23 @@ class BattlegroundAB : public Battleground
BattlegroundAB();
~BattlegroundAB();
void AddPlayer(Player *plr);
void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
virtual bool SetupBattleground();
virtual void Reset();
void EndBattleground(uint32 winner);
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
/* Scorekeeping */
virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
virtual void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
virtual void FillInitialWorldStates(WorldPacket& data);
/* Nodes occupying */
virtual void EventPlayerClickedOnFlag(Player *source, GameObject* target_obj);
virtual void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj);
/* achievement req. */
bool IsAllNodesConrolledByTeam(uint32 team) const; // overwrited
@@ -422,7 +422,7 @@ void BattlegroundAV::StartingEventOpenDoors()
DoorOpen(BG_AV_OBJECT_DOOR_A);
}
void BattlegroundAV::AddPlayer(Player *plr)
void BattlegroundAV::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -486,7 +486,7 @@ void BattlegroundAV::RemovePlayer(Player* plr, uint64 /*guid*/, uint32 /*team*/)
plr->RemoveAurasDueToSpell(AV_BUFF_H_CAPTAIN);
}
void BattlegroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundAV::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
@@ -853,7 +853,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
//called when using banner
void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target_obj)
void BattlegroundAV::EventPlayerClickedOnFlag(Player* source, GameObject* target_obj)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -1029,8 +1029,8 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
std::vector<uint64> ghost_list = m_ReviveQueue[m_BgCreatures[node]];
if (!ghost_list.empty())
{
Player *plr;
WorldSafeLocsEntry const *ClosestGrave = NULL;
Player* plr;
WorldSafeLocsEntry const* ClosestGrave = NULL;
for (std::vector<uint64>::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
{
plr = ObjectAccessor::FindPlayer(*ghost_list.begin());
@@ -1539,21 +1539,21 @@ class BattlegroundAV : public Battleground
~BattlegroundAV();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
virtual void ResetBGSubclass();
/*general stuff*/
void UpdateScore(uint16 team, int16 points);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
/*handlestuff*/ //these are functions which get called from extern
virtual void EventPlayerClickedOnFlag(Player *source, GameObject* target_obj);
virtual void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj);
void HandleKillPlayer(Player* player, Player* killer);
void HandleKillUnit(Creature* unit, Player* killer);
void HandleQuestComplete(uint32 questid, Player* player);
@@ -62,7 +62,7 @@ void BattlegroundBE::StartingEventOpenDoors()
SpawnBGObject(i, 60);
}
void BattlegroundBE::AddPlayer(Player *plr)
void BattlegroundBE::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -105,7 +105,7 @@ bool BattlegroundBE::HandlePlayerUnderMap(Player* player)
return true;
}
void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundBE::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
@@ -55,12 +55,12 @@ class BattlegroundBE : public Battleground
~BattlegroundBE();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
@@ -68,6 +68,6 @@ class BattlegroundBE : public Battleground
bool HandlePlayerUnderMap(Player* plr);
/* Scorekeeping */
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
};
#endif
@@ -88,7 +88,7 @@ void BattlegroundDS::StartingEventOpenDoors()
SpawnBGObject(i, getWaterFallTimer());
}
void BattlegroundDS::AddPlayer(Player *plr)
void BattlegroundDS::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -125,7 +125,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
CheckArenaWinConditions();
}
void BattlegroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -64,12 +64,12 @@ class BattlegroundDS : public Battleground
~BattlegroundDS();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
@@ -137,7 +137,7 @@ void BattlegroundEY::AddPoints(uint32 Team, uint32 Points)
void BattlegroundEY::CheckSomeoneJoinedPoint()
{
GameObject *obj = NULL;
GameObject* obj = NULL;
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
obj = HashMapHolder<GameObject>::Find(m_BgObjects[BG_EY_OBJECT_TOWER_CAP_FEL_REAVER + i]);
@@ -146,7 +146,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
uint8 j = 0;
while (j < m_PlayersNearPoint[EY_POINTS_MAX].size())
{
Player *plr = ObjectAccessor::FindPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
Player* plr = ObjectAccessor::FindPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
if (!plr)
{
sLog->outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
@@ -177,7 +177,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
//reset current point counts
for (uint8 i = 0; i < 2*EY_POINTS_MAX; ++i)
m_CurrentPointPlayersCount[i] = 0;
GameObject *obj = NULL;
GameObject* obj = NULL;
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
obj = HashMapHolder<GameObject>::Find(m_BgObjects[BG_EY_OBJECT_TOWER_CAP_FEL_REAVER + i]);
@@ -186,7 +186,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
uint8 j = 0;
while (j < m_PlayersNearPoint[i].size())
{
Player *plr = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
Player* plr = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
if (!plr)
{
sLog->outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
@@ -241,7 +241,7 @@ void BattlegroundEY::UpdatePointStatuses()
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{
Player *plr = ObjectAccessor::FindPlayer(m_PlayersNearPoint[point][i]);
Player* plr = ObjectAccessor::FindPlayer(m_PlayersNearPoint[point][i]);
if (plr)
{
this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
@@ -330,7 +330,7 @@ void BattlegroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
}
}
void BattlegroundEY::AddPlayer(Player *plr)
void BattlegroundEY::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map
@@ -341,7 +341,7 @@ void BattlegroundEY::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
}
void BattlegroundEY::RemovePlayer(Player *plr, uint64 guid, uint32 /*team*/)
void BattlegroundEY::RemovePlayer(Player* plr, uint64 guid, uint32 /*team*/)
{
// sometimes flag aura not removed :(
for (int j = EY_POINTS_MAX; j >= 0; --j)
@@ -365,7 +365,7 @@ void BattlegroundEY::RemovePlayer(Player *plr, uint64 guid, uint32 /*team*/)
}
}
void BattlegroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -491,7 +491,7 @@ bool BattlegroundEY::SetupBattleground()
sLog->outError("BattlegroundEY: Cannot spawn buff");
}
WorldSafeLocsEntry const *sg = NULL;
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
@@ -563,7 +563,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
{
RespawnFlag(true);
GameObject *obj = HashMapHolder<GameObject>::Find(GetDroppedFlagGUID());
GameObject* obj = HashMapHolder<GameObject>::Find(GetDroppedFlagGUID());
if (obj)
obj->Delete();
else
@@ -581,7 +581,7 @@ void BattlegroundEY::HandleKillPlayer(Player* player, Player* killer)
EventPlayerDroppedFlag(player);
}
void BattlegroundEY::EventPlayerDroppedFlag(Player *Source)
void BattlegroundEY::EventPlayerDroppedFlag(Player* Source)
{
if (GetStatus() != STATUS_IN_PROGRESS)
{
@@ -617,7 +617,7 @@ void BattlegroundEY::EventPlayerDroppedFlag(Player *Source)
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
}
void BattlegroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
void BattlegroundEY::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj)
{
if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
return;
@@ -649,7 +649,7 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName());
}
void BattlegroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
void BattlegroundEY::EventTeamLostPoint(Player* Source, uint32 Point)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -697,7 +697,7 @@ void BattlegroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
DelCreature(Point + 6);//NULL checks are in DelCreature! 0-5 spirit guides
}
void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
void BattlegroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -736,7 +736,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
if (m_BgCreatures[Point])
DelCreature(Point);
WorldSafeLocsEntry const *sg = NULL;
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
sLog->outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
@@ -764,7 +764,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
}
}
void BattlegroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
void BattlegroundEY::EventPlayerCapturedFlag(Player* Source, uint32 BgObjectType)
{
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
return;
@@ -803,7 +803,7 @@ void BattlegroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1);
}
void BattlegroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
void BattlegroundEY::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
{
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
if (itr == m_PlayerScores.end()) // player not found
@@ -871,7 +871,7 @@ void BattlegroundEY::FillInitialWorldStates(WorldPacket& data)
data << uint32(0xc0d) << uint32(0x17b);
}
WorldSafeLocsEntry const *BattlegroundEY::GetClosestGraveYard(Player* player)
WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
{
uint32 g_id = 0;
@@ -336,7 +336,7 @@ class BattlegroundEY : public Battleground
~BattlegroundEY();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
@@ -348,32 +348,32 @@ class BattlegroundEY : public Battleground
void RespawnFlag(bool send_message);
void RespawnFlagAfterDrop();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleBuffUse(uint64 buff_guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
void HandleKillPlayer(Player* player, Player* killer);
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
virtual bool SetupBattleground();
virtual void Reset();
void UpdateTeamScore(uint32 Team);
void EndBattleground(uint32 winner);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
virtual void FillInitialWorldStates(WorldPacket& data);
void SetDroppedFlagGUID(uint64 guid) { m_DroppedFlagGUID = guid;}
uint64 GetDroppedFlagGUID() const { return m_DroppedFlagGUID;}
/* Battleground Events */
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
virtual void EventPlayerDroppedFlag(Player *Source);
virtual void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj);
virtual void EventPlayerDroppedFlag(Player* Source);
/* achievement req. */
bool IsAllNodesConrolledByTeam(uint32 team) const;
private:
virtual void PostUpdateImpl(uint32 diff);
void EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType);
void EventTeamCapturedPoint(Player *Source, uint32 Point);
void EventTeamLostPoint(Player *Source, uint32 Point);
void EventPlayerCapturedFlag(Player* Source, uint32 BgObjectType);
void EventTeamCapturedPoint(Player* Source, uint32 Point);
void EventTeamLostPoint(Player* Source, uint32 Point);
void UpdatePointsCount(uint32 Team);
void UpdatePointsIcons(uint32 Team, uint32 Point);
@@ -292,7 +292,7 @@ bool BattlegroundIC::IsAllNodesConrolledByTeam(uint32 team) const
return count == NODE_TYPE_WORKSHOP;
}
void BattlegroundIC::AddPlayer(Player *plr)
void BattlegroundIC::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -479,7 +479,7 @@ void BattlegroundIC::RealocatePlayers(ICNodePointType nodeType)
std::vector<uint64> ghost_list = m_ReviveQueue[m_BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1+nodeType-2]];
if (!ghost_list.empty())
{
WorldSafeLocsEntry const *ClosestGrave = NULL;
WorldSafeLocsEntry const* ClosestGrave = NULL;
for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
{
Player* plr = ObjectAccessor::FindPlayer(*itr);
@@ -862,19 +862,19 @@ class BattlegroundIC : public Battleground
~BattlegroundIC();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
virtual void PostUpdateImpl(uint32 diff);
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
void SpawnLeader(uint32 teamid);
void HandleKillUnit(Creature* unit, Player* killer);
void HandleKillPlayer(Player* player, Player* killer);
void EndBattleground(uint32 winner);
void EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/);
void EventPlayerClickedOnFlag(Player* source, GameObject* /*target_obj*/);
void EventPlayerDamagedGO(Player* /*plr*/, GameObject* go, uint32 eventType);
void DestroyGate(Player* player, GameObject* go);
@@ -882,7 +882,7 @@ class BattlegroundIC : public Battleground
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
/* Scorekeeping */
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
void FillInitialWorldStates(WorldPacket& data);
@@ -59,7 +59,7 @@ void BattlegroundNA::StartingEventOpenDoors()
SpawnBGObject(i, 60);
}
void BattlegroundNA::AddPlayer(Player *plr)
void BattlegroundNA::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -102,7 +102,7 @@ bool BattlegroundNA::HandlePlayerUnderMap(Player* player)
return true;
}
void BattlegroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundNA::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -56,12 +56,12 @@ class BattlegroundNA : public Battleground
~BattlegroundNA();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
@@ -43,7 +43,7 @@ void BattlegroundRB::StartingEventOpenDoors()
{
}
void BattlegroundRB::AddPlayer(Player *plr)
void BattlegroundRB::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -34,15 +34,15 @@ class BattlegroundRB : public Battleground
BattlegroundRB();
~BattlegroundRB();
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
/* Scorekeeping */
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
private:
};
@@ -59,7 +59,7 @@ void BattlegroundRL::StartingEventOpenDoors()
SpawnBGObject(i, 60);
}
void BattlegroundRL::AddPlayer(Player *plr)
void BattlegroundRL::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -102,7 +102,7 @@ bool BattlegroundRL::HandlePlayerUnderMap(Player* player)
return true;
}
void BattlegroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundRL::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
@@ -52,14 +52,14 @@ class BattlegroundRL : public Battleground
~BattlegroundRL();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
void HandleKillPlayer(Player* player, Player* killer);
bool HandlePlayerUnderMap(Player* plr);
@@ -102,7 +102,7 @@ void BattlegroundRV::StartingEventOpenDoors()
setTimer(BG_RV_FIRST_TIMER);
}
void BattlegroundRV::AddPlayer(Player *plr)
void BattlegroundRV::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -150,7 +150,7 @@ bool BattlegroundRV::HandlePlayerUnderMap(Player* player)
return true;
}
void BattlegroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundRV::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -105,14 +105,14 @@ class BattlegroundRV : public Battleground
~BattlegroundRV();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
bool SetupBattleground();
void HandleKillPlayer(Player* player, Player* killer);
bool HandlePlayerUnderMap(Player* plr);
@@ -62,7 +62,7 @@ bool BattlegroundSA::SetupBattleground()
bool BattlegroundSA::ResetObjs()
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
SendTransportsRemove(plr);
uint32 atF = BG_SA_Factions[Attackers];
@@ -150,7 +150,7 @@ bool BattlegroundSA::ResetObjs()
//Graveyards!
for (uint8 i = 0;i < BG_SA_MAX_GY; i++)
{
WorldSafeLocsEntry const *sg = NULL;
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
if (!sg)
@@ -245,7 +245,7 @@ bool BattlegroundSA::ResetObjs()
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
SendTransportInit(plr);
TeleportPlayers();
@@ -431,7 +431,7 @@ void BattlegroundSA::FillInitialWorldStates(WorldPacket& data)
data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << ally_attacks;
}
void BattlegroundSA::AddPlayer(Player *plr)
void BattlegroundSA::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -492,7 +492,7 @@ void BattlegroundSA::TeleportPlayers()
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
{
// should remove spirit of redemption
if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
@@ -684,7 +684,7 @@ void BattlegroundSA::SendTime()
UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round%60000)%10000)/1000);
}
void BattlegroundSA::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
void BattlegroundSA::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj)
{
switch(target_obj->GetEntry())
{
@@ -708,14 +708,14 @@ void BattlegroundSA::EventPlayerClickedOnFlag(Player *Source, GameObject* target
};
}
void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
{
if (GraveyardStatus[i] == Attackers)
return;
DelCreature(BG_SA_MAXNPC + i);
GraveyardStatus[i] = Source->GetTeamId();
WorldSafeLocsEntry const *sg = NULL;
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], (GraveyardStatus[i] == TEAM_ALLIANCE? ALLIANCE : HORDE));
uint32 npc = 0;
@@ -798,7 +798,7 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
//Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
if (plr->GetTeamId() == Attackers)
plr->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65246);
}
@@ -822,7 +822,7 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
//Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
if (Player* plr = ObjectAccessor::FindPlayer(itr->first))
if (plr->GetTeamId() == Attackers && RoundScores[1].winner == Attackers)
plr->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65246);
}
@@ -865,7 +865,7 @@ void BattlegroundSA::UpdateDemolisherSpawns()
{
if (m_BgCreatures[i])
{
if (Creature *Demolisher = GetBGCreature(i))
if (Creature* Demolisher = GetBGCreature(i))
{
if (Demolisher->isDead())
{
@@ -423,7 +423,7 @@ class BattlegroundSA : public Battleground
/* inherited from BattlegroundClass */
/// Called when a player join battle
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
/// Called when battle start
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
@@ -439,7 +439,7 @@ class BattlegroundSA : public Battleground
/// Return the nearest graveyard where player can respawn
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
/// Called when a player click on flag (graveyard flag)
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
virtual void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj);
/// Called when a player use a gamobject (relic)
virtual void EventPlayerUsedGO(Player* Source, GameObject* object);
/// Return gate id, relative to bg data, according to gameobject id
@@ -477,12 +477,12 @@ class BattlegroundSA : public Battleground
void EndBattleground(uint32 winner);
/// CAlled when a player leave battleground
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
/* Scorekeeping */
/// Update score board
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
// Achievement Defense of the Ancients
bool gateDestroyed;
@@ -530,7 +530,7 @@ class BattlegroundSA : public Battleground
* \param i : id of graveyard
* \param Source : Player who capture gy
*/
void CaptureGraveyard(BG_SA_Graveyards i, Player *Source);
void CaptureGraveyard(BG_SA_Graveyards i, Player* Source);
/// Switch on/off timer worldstate
void ToggleTimer();
@@ -202,7 +202,7 @@ void BattlegroundWS::StartingEventOpenDoors()
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, WS_EVENT_START_BATTLE);
}
void BattlegroundWS::AddPlayer(Player *plr)
void BattlegroundWS::AddPlayer(Player* plr)
{
Battleground::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
@@ -254,7 +254,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED);
if (GameObject *obj = GetBgMap()->GetGameObject(GetDroppedFlagGUID(team)))
if (GameObject* obj = GetBgMap()->GetGameObject(GetDroppedFlagGUID(team)))
obj->Delete();
else
sLog->outError("unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
@@ -263,7 +263,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
m_BothFlagsKept = false;
}
void BattlegroundWS::EventPlayerCapturedFlag(Player *Source)
void BattlegroundWS::EventPlayerCapturedFlag(Player* Source)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -349,7 +349,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player *Source)
}
}
void BattlegroundWS::EventPlayerDroppedFlag(Player *Source)
void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
{
if (GetStatus() != STATUS_IN_PROGRESS)
{
@@ -435,7 +435,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player *Source)
}
}
void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -556,7 +556,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
}
void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid, uint32 /*team*/)
void BattlegroundWS::RemovePlayer(Player* plr, uint64 guid, uint32 /*team*/)
{
// sometimes flag aura not removed :(
if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
@@ -599,7 +599,7 @@ void BattlegroundWS::UpdateTeamScore(uint32 team)
UpdateWorldState(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(team));
}
void BattlegroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
@@ -682,7 +682,7 @@ bool BattlegroundWS::SetupBattleground()
return false;
}
WorldSafeLocsEntry const *sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
sLog->outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
@@ -754,7 +754,7 @@ void BattlegroundWS::HandleKillPlayer(Player* player, Player* killer)
Battleground::HandleKillPlayer(player, killer);
}
void BattlegroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
void BattlegroundWS::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
{
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
@@ -163,7 +163,7 @@ class BattlegroundWS : public Battleground
~BattlegroundWS();
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void AddPlayer(Player* plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
@@ -183,12 +183,12 @@ class BattlegroundWS : public Battleground
bool IsForceTimerDone;
/* Battleground Events */
virtual void EventPlayerDroppedFlag(Player *Source);
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
virtual void EventPlayerCapturedFlag(Player *Source);
virtual void EventPlayerDroppedFlag(Player* Source);
virtual void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj);
virtual void EventPlayerCapturedFlag(Player* Source);
void RemovePlayer(Player *plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void RemovePlayer(Player* plr, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
void HandleKillPlayer(Player* player, Player* killer);
bool SetupBattleground();
virtual void Reset();
@@ -198,7 +198,7 @@ class BattlegroundWS : public Battleground
void UpdateFlagState(uint32 team, uint32 value);
void SetLastFlagCapture(uint32 team) { m_LastFlagCaptureTeam = team; }
void UpdateTeamScore(uint32 team);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
void SetDroppedFlagGUID(uint64 guid, uint32 TeamID) { m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)] = guid;}
uint64 GetDroppedFlagGUID(uint32 TeamID) { return m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)];}
virtual void FillInitialWorldStates(WorldPacket& data);
+58 -58
View File
@@ -62,7 +62,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
if (result) //load
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
m_announce = fields[0].GetBool();
m_ownership = fields[1].GetBool();
m_password = fields[2].GetString();
@@ -169,7 +169,7 @@ void Channel::Join(uint64 p, const char *pass)
return;
}
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (plr)
{
@@ -231,7 +231,7 @@ void Channel::Leave(uint64 p, bool send)
}
else
{
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (send)
{
@@ -274,7 +274,7 @@ void Channel::Leave(uint64 p, bool send)
void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
{
AccountTypes sec = SEC_PLAYER;
Player *gplr = ObjectAccessor::FindPlayer(good);
Player* gplr = ObjectAccessor::FindPlayer(good);
if (gplr)
sec = gplr->GetSession()->GetSecurity();
@@ -292,7 +292,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
}
else
{
Player *bad = sObjectAccessor->FindPlayerByName(badname);
Player* bad = sObjectAccessor->FindPlayerByName(badname);
if (bad == NULL || !IsOn(bad->GetGUID()))
{
WorldPacket data;
@@ -338,7 +338,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
void Channel::UnBan(uint64 good, const char *badname)
{
uint32 sec = 0;
Player *gplr = ObjectAccessor::FindPlayer(good);
Player* gplr = ObjectAccessor::FindPlayer(good);
if (gplr)
sec = gplr->GetSession()->GetSecurity();
@@ -356,7 +356,7 @@ void Channel::UnBan(uint64 good, const char *badname)
}
else
{
Player *bad = sObjectAccessor->FindPlayerByName(badname);
Player* bad = sObjectAccessor->FindPlayerByName(badname);
if (bad == NULL || !IsBanned(bad->GetGUID()))
{
WorldPacket data;
@@ -379,7 +379,7 @@ void Channel::UnBan(uint64 good, const char *badname)
void Channel::Password(uint64 p, const char *pass)
{
uint32 sec = 0;
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (plr)
sec = plr->GetSession()->GetSecurity();
@@ -411,7 +411,7 @@ void Channel::Password(uint64 p, const char *pass)
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
{
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (!plr)
return;
@@ -431,7 +431,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
}
else
{
Player *newp = sObjectAccessor->FindPlayerByName(p2n);
Player* newp = sObjectAccessor->FindPlayerByName(p2n);
if (!newp)
{
WorldPacket data;
@@ -479,7 +479,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
void Channel::SetOwner(uint64 p, const char *newname)
{
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (!plr)
return;
@@ -501,7 +501,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
return;
}
Player *newp = sObjectAccessor->FindPlayerByName(newname);
Player* newp = sObjectAccessor->FindPlayerByName(newname);
if (newp == NULL || !IsOn(newp->GetGUID()))
{
WorldPacket data;
@@ -563,7 +563,7 @@ void Channel::List(Player* player)
uint32 count = 0;
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = ObjectAccessor::FindPlayer(i->first);
Player* plr = ObjectAccessor::FindPlayer(i->first);
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
@@ -585,7 +585,7 @@ void Channel::List(Player* player)
void Channel::Announce(uint64 p)
{
uint32 sec = 0;
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (plr)
sec = plr->GetSession()->GetSecurity();
@@ -623,7 +623,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
lang = LANG_UNIVERSAL;
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (!IsOn(p))
{
@@ -666,7 +666,7 @@ void Channel::Invite(uint64 p, const char *newname)
return;
}
Player *newp = sObjectAccessor->FindPlayerByName(newname);
Player* newp = sObjectAccessor->FindPlayerByName(newname);
if (!newp)
{
WorldPacket data;
@@ -683,7 +683,7 @@ void Channel::Invite(uint64 p, const char *newname)
return;
}
Player *plr = ObjectAccessor::FindPlayer(p);
Player* plr = ObjectAccessor::FindPlayer(p);
if (!plr)
return;
@@ -745,11 +745,11 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
}
}
void Channel::SendToAll(WorldPacket *data, uint64 p)
void Channel::SendToAll(WorldPacket* data, uint64 p)
{
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = ObjectAccessor::FindPlayer(i->first);
Player* plr = ObjectAccessor::FindPlayer(i->first);
if (plr)
{
if (!p || !plr->GetSocial()->HasIgnore(GUID_LOPART(p)))
@@ -758,22 +758,22 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
}
}
void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
void Channel::SendToAllButOne(WorldPacket* data, uint64 who)
{
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
if (i->first != who)
{
Player *plr = ObjectAccessor::FindPlayer(i->first);
Player* plr = ObjectAccessor::FindPlayer(i->first);
if (plr)
plr->GetSession()->SendPacket(data);
}
}
}
void Channel::SendToOne(WorldPacket *data, uint64 who)
void Channel::SendToOne(WorldPacket* data, uint64 who)
{
Player *plr = ObjectAccessor::FindPlayer(who);
Player* plr = ObjectAccessor::FindPlayer(who);
if (plr)
plr->GetSession()->SendPacket(data);
}
@@ -789,7 +789,7 @@ void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/)
}
// done
void Channel::MakeNotifyPacket(WorldPacket *data, uint8 notify_type)
void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type)
{
data->Initialize(SMSG_CHANNEL_NOTIFY, 1+m_name.size()+1);
*data << uint8(notify_type);
@@ -797,21 +797,21 @@ void Channel::MakeNotifyPacket(WorldPacket *data, uint8 notify_type)
}
// done 0x00
void Channel::MakeJoined(WorldPacket *data, uint64 guid)
void Channel::MakeJoined(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_JOINED_NOTICE);
*data << uint64(guid);
}
// done 0x01
void Channel::MakeLeft(WorldPacket *data, uint64 guid)
void Channel::MakeLeft(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_LEFT_NOTICE);
*data << uint64(guid);
}
// done 0x02
void Channel::MakeYouJoined(WorldPacket *data)
void Channel::MakeYouJoined(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_YOU_JOINED_NOTICE);
*data << uint8(GetFlags());
@@ -820,7 +820,7 @@ void Channel::MakeYouJoined(WorldPacket *data)
}
// done 0x03
void Channel::MakeYouLeft(WorldPacket *data)
void Channel::MakeYouLeft(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_YOU_LEFT_NOTICE);
*data << uint32(GetChannelId());
@@ -828,52 +828,52 @@ void Channel::MakeYouLeft(WorldPacket *data)
}
// done 0x04
void Channel::MakeWrongPassword(WorldPacket *data)
void Channel::MakeWrongPassword(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_WRONG_PASSWORD_NOTICE);
}
// done 0x05
void Channel::MakeNotMember(WorldPacket *data)
void Channel::MakeNotMember(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_NOT_MEMBER_NOTICE);
}
// done 0x06
void Channel::MakeNotModerator(WorldPacket *data)
void Channel::MakeNotModerator(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE);
}
// done 0x07
void Channel::MakePasswordChanged(WorldPacket *data, uint64 guid)
void Channel::MakePasswordChanged(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE);
*data << uint64(guid);
}
// done 0x08
void Channel::MakeOwnerChanged(WorldPacket *data, uint64 guid)
void Channel::MakeOwnerChanged(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE);
*data << uint64(guid);
}
// done 0x09
void Channel::MakePlayerNotFound(WorldPacket *data, const std::string& name)
void Channel::MakePlayerNotFound(WorldPacket* data, const std::string& name)
{
MakeNotifyPacket(data, CHAT_PLAYER_NOT_FOUND_NOTICE);
*data << name;
}
// done 0x0A
void Channel::MakeNotOwner(WorldPacket *data)
void Channel::MakeNotOwner(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_NOT_OWNER_NOTICE);
}
// done 0x0B
void Channel::MakeChannelOwner(WorldPacket *data)
void Channel::MakeChannelOwner(WorldPacket* data)
{
std::string name = "";
@@ -885,7 +885,7 @@ void Channel::MakeChannelOwner(WorldPacket *data)
}
// done 0x0C
void Channel::MakeModeChange(WorldPacket *data, uint64 guid, uint8 oldflags)
void Channel::MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags)
{
MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE);
*data << uint64(guid);
@@ -894,27 +894,27 @@ void Channel::MakeModeChange(WorldPacket *data, uint64 guid, uint8 oldflags)
}
// done 0x0D
void Channel::MakeAnnouncementsOn(WorldPacket *data, uint64 guid)
void Channel::MakeAnnouncementsOn(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE);
*data << uint64(guid);
}
// done 0x0E
void Channel::MakeAnnouncementsOff(WorldPacket *data, uint64 guid)
void Channel::MakeAnnouncementsOff(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE);
*data << uint64(guid);
}
// done 0x11
void Channel::MakeMuted(WorldPacket *data)
void Channel::MakeMuted(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_MUTED_NOTICE);
}
// done 0x12
void Channel::MakePlayerKicked(WorldPacket *data, uint64 bad, uint64 good)
void Channel::MakePlayerKicked(WorldPacket* data, uint64 bad, uint64 good)
{
MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE);
*data << uint64(bad);
@@ -922,13 +922,13 @@ void Channel::MakePlayerKicked(WorldPacket *data, uint64 bad, uint64 good)
}
// done 0x13
void Channel::MakeBanned(WorldPacket *data)
void Channel::MakeBanned(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_BANNED_NOTICE);
}
// done 0x14
void Channel::MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good)
void Channel::MakePlayerBanned(WorldPacket* data, uint64 bad, uint64 good)
{
MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE);
*data << uint64(bad);
@@ -936,7 +936,7 @@ void Channel::MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good)
}
// done 0x15
void Channel::MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good)
void Channel::MakePlayerUnbanned(WorldPacket* data, uint64 bad, uint64 good)
{
MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE);
*data << uint64(bad);
@@ -944,91 +944,91 @@ void Channel::MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good)
}
// done 0x16
void Channel::MakePlayerNotBanned(WorldPacket *data, const std::string &name)
void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name)
{
MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE);
*data << name;
}
// done 0x17
void Channel::MakePlayerAlreadyMember(WorldPacket *data, uint64 guid)
void Channel::MakePlayerAlreadyMember(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE);
*data << uint64(guid);
}
// done 0x18
void Channel::MakeInvite(WorldPacket *data, uint64 guid)
void Channel::MakeInvite(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_INVITE_NOTICE);
*data << uint64(guid);
}
// done 0x19
void Channel::MakeInviteWrongFaction(WorldPacket *data)
void Channel::MakeInviteWrongFaction(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_INVITE_WRONG_FACTION_NOTICE);
}
// done 0x1A
void Channel::MakeWrongFaction(WorldPacket *data)
void Channel::MakeWrongFaction(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_WRONG_FACTION_NOTICE);
}
// done 0x1B
void Channel::MakeInvalidName(WorldPacket *data)
void Channel::MakeInvalidName(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_INVALID_NAME_NOTICE);
}
// done 0x1C
void Channel::MakeNotModerated(WorldPacket *data)
void Channel::MakeNotModerated(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_NOT_MODERATED_NOTICE);
}
// done 0x1D
void Channel::MakePlayerInvited(WorldPacket *data, const std::string& name)
void Channel::MakePlayerInvited(WorldPacket* data, const std::string& name)
{
MakeNotifyPacket(data, CHAT_PLAYER_INVITED_NOTICE);
*data << name;
}
// done 0x1E
void Channel::MakePlayerInviteBanned(WorldPacket *data, const std::string& name)
void Channel::MakePlayerInviteBanned(WorldPacket* data, const std::string& name)
{
MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE);
*data << name;
}
// done 0x1F
void Channel::MakeThrottled(WorldPacket *data)
void Channel::MakeThrottled(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_THROTTLED_NOTICE);
}
// done 0x20
void Channel::MakeNotInArea(WorldPacket *data)
void Channel::MakeNotInArea(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_NOT_IN_AREA_NOTICE);
}
// done 0x21
void Channel::MakeNotInLfg(WorldPacket *data)
void Channel::MakeNotInLfg(WorldPacket* data)
{
MakeNotifyPacket(data, CHAT_NOT_IN_LFG_NOTICE);
}
// done 0x22
void Channel::MakeVoiceOn(WorldPacket *data, uint64 guid)
void Channel::MakeVoiceOn(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE);
*data << uint64(guid);
}
// done 0x23
void Channel::MakeVoiceOff(WorldPacket *data, uint64 guid)
void Channel::MakeVoiceOff(WorldPacket* data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE);
*data << uint64(guid);
+38 -38
View File
@@ -161,46 +161,46 @@ class Channel
private:
// initial packet data (notify type and channel name)
void MakeNotifyPacket(WorldPacket *data, uint8 notify_type);
void MakeNotifyPacket(WorldPacket* data, uint8 notify_type);
// type specific packet data
void MakeJoined(WorldPacket *data, uint64 guid); //+ 0x00
void MakeLeft(WorldPacket *data, uint64 guid); //+ 0x01
void MakeYouJoined(WorldPacket *data); //+ 0x02
void MakeYouLeft(WorldPacket *data); //+ 0x03
void MakeWrongPassword(WorldPacket *data); //? 0x04
void MakeNotMember(WorldPacket *data); //? 0x05
void MakeNotModerator(WorldPacket *data); //? 0x06
void MakePasswordChanged(WorldPacket *data, uint64 guid); //+ 0x07
void MakeOwnerChanged(WorldPacket *data, uint64 guid); //? 0x08
void MakePlayerNotFound(WorldPacket *data, const std::string& name); //+ 0x09
void MakeNotOwner(WorldPacket *data); //? 0x0A
void MakeChannelOwner(WorldPacket *data); //? 0x0B
void MakeModeChange(WorldPacket *data, uint64 guid, uint8 oldflags); //+ 0x0C
void MakeAnnouncementsOn(WorldPacket *data, uint64 guid); //+ 0x0D
void MakeAnnouncementsOff(WorldPacket *data, uint64 guid); //+ 0x0E
void MakeMuted(WorldPacket *data); //? 0x11
void MakePlayerKicked(WorldPacket *data, uint64 bad, uint64 good); //? 0x12
void MakeBanned(WorldPacket *data); //? 0x13
void MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good); //? 0x14
void MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good); //? 0x15
void MakePlayerNotBanned(WorldPacket *data, const std::string& name); //? 0x16
void MakePlayerAlreadyMember(WorldPacket *data, uint64 guid); //+ 0x17
void MakeInvite(WorldPacket *data, uint64 guid); //? 0x18
void MakeInviteWrongFaction(WorldPacket *data); //? 0x19
void MakeWrongFaction(WorldPacket *data); //? 0x1A
void MakeInvalidName(WorldPacket *data); //? 0x1B
void MakeNotModerated(WorldPacket *data); //? 0x1C
void MakePlayerInvited(WorldPacket *data, const std::string& name); //+ 0x1D
void MakePlayerInviteBanned(WorldPacket *data, const std::string &name);//? 0x1E
void MakeThrottled(WorldPacket *data); //? 0x1F
void MakeNotInArea(WorldPacket *data); //? 0x20
void MakeNotInLfg(WorldPacket *data); //? 0x21
void MakeVoiceOn(WorldPacket *data, uint64 guid); //+ 0x22
void MakeVoiceOff(WorldPacket *data, uint64 guid); //+ 0x23
void MakeJoined(WorldPacket* data, uint64 guid); //+ 0x00
void MakeLeft(WorldPacket* data, uint64 guid); //+ 0x01
void MakeYouJoined(WorldPacket* data); //+ 0x02
void MakeYouLeft(WorldPacket* data); //+ 0x03
void MakeWrongPassword(WorldPacket* data); //? 0x04
void MakeNotMember(WorldPacket* data); //? 0x05
void MakeNotModerator(WorldPacket* data); //? 0x06
void MakePasswordChanged(WorldPacket* data, uint64 guid); //+ 0x07
void MakeOwnerChanged(WorldPacket* data, uint64 guid); //? 0x08
void MakePlayerNotFound(WorldPacket* data, const std::string& name); //+ 0x09
void MakeNotOwner(WorldPacket* data); //? 0x0A
void MakeChannelOwner(WorldPacket* data); //? 0x0B
void MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags); //+ 0x0C
void MakeAnnouncementsOn(WorldPacket* data, uint64 guid); //+ 0x0D
void MakeAnnouncementsOff(WorldPacket* data, uint64 guid); //+ 0x0E
void MakeMuted(WorldPacket* data); //? 0x11
void MakePlayerKicked(WorldPacket* data, uint64 bad, uint64 good); //? 0x12
void MakeBanned(WorldPacket* data); //? 0x13
void MakePlayerBanned(WorldPacket* data, uint64 bad, uint64 good); //? 0x14
void MakePlayerUnbanned(WorldPacket* data, uint64 bad, uint64 good); //? 0x15
void MakePlayerNotBanned(WorldPacket* data, const std::string& name); //? 0x16
void MakePlayerAlreadyMember(WorldPacket* data, uint64 guid); //+ 0x17
void MakeInvite(WorldPacket* data, uint64 guid); //? 0x18
void MakeInviteWrongFaction(WorldPacket* data); //? 0x19
void MakeWrongFaction(WorldPacket* data); //? 0x1A
void MakeInvalidName(WorldPacket* data); //? 0x1B
void MakeNotModerated(WorldPacket* data); //? 0x1C
void MakePlayerInvited(WorldPacket* data, const std::string& name); //+ 0x1D
void MakePlayerInviteBanned(WorldPacket* data, const std::string &name);//? 0x1E
void MakeThrottled(WorldPacket* data); //? 0x1F
void MakeNotInArea(WorldPacket* data); //? 0x20
void MakeNotInLfg(WorldPacket* data); //? 0x21
void MakeVoiceOn(WorldPacket* data, uint64 guid); //+ 0x22
void MakeVoiceOff(WorldPacket* data, uint64 guid); //+ 0x23
void SendToAll(WorldPacket *data, uint64 p = 0);
void SendToAllButOne(WorldPacket *data, uint64 who);
void SendToOne(WorldPacket *data, uint64 who);
void SendToAll(WorldPacket* data, uint64 p = 0);
void SendToAllButOne(WorldPacket* data, uint64 who);
void SendToOne(WorldPacket* data, uint64 who);
bool IsOn(uint64 who) const { return players.find(who) != players.end(); }
bool IsBanned(uint64 guid) const { return banned.find(guid) != banned.end(); }
+4 -4
View File
@@ -41,7 +41,7 @@ ChannelMgr::~ChannelMgr()
channels.clear();
}
Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
Channel* ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
{
std::wstring wname;
Utf8toWStr(name, wname);
@@ -49,7 +49,7 @@ Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
if (channels.find(wname) == channels.end())
{
Channel *nchan = new Channel(name, channel_id, team);
Channel* nchan = new Channel(name, channel_id, team);
channels[wname] = nchan;
return nchan;
}
@@ -57,7 +57,7 @@ Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
return channels[wname];
}
Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt)
Channel* ChannelMgr::GetChannel(std::string name, Player* p, bool pkt)
{
std::wstring wname;
Utf8toWStr(name, wname);
@@ -100,7 +100,7 @@ void ChannelMgr::LeftChannel(std::string name)
}
}
void ChannelMgr::MakeNotOnPacket(WorldPacket *data, std::string name)
void ChannelMgr::MakeNotOnPacket(WorldPacket* data, std::string name)
{
data->Initialize(SMSG_CHANNEL_NOTIFY, (1+10)); // we guess size
(*data) << (uint8)0x05 << name;
+3 -3
View File
@@ -35,12 +35,12 @@ class ChannelMgr
ChannelMgr() {team = 0;}
~ChannelMgr();
Channel *GetJoinChannel(std::string name, uint32 channel_id);
Channel *GetChannel(std::string name, Player *p, bool pkt = true);
Channel* GetJoinChannel(std::string name, uint32 channel_id);
Channel* GetChannel(std::string name, Player* p, bool pkt = true);
void LeftChannel(std::string name);
private:
ChannelMap channels;
void MakeNotOnPacket(WorldPacket *data, std::string name);
void MakeNotOnPacket(WorldPacket* data, std::string name);
};
class AllianceChannelMgr : public ChannelMgr {};
+8 -8
View File
@@ -65,7 +65,7 @@ static size_t appendCommandTable(ChatCommand* target, const ChatCommand* source)
return count;
}
ChatCommand * ChatHandler::getCommandTable()
ChatCommand* ChatHandler::getCommandTable()
{
static ChatCommand banCommandTable[] =
{
@@ -447,7 +447,7 @@ ChatCommand * ChatHandler::getCommandTable()
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
std::string name = fields[0].GetString();
SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt16(), fields[2].GetString(), name);
@@ -634,7 +634,7 @@ void ChatHandler::PSendSysMessage(const char *format, ...)
SendSysMessage(str);
}
bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, const std::string& fullcmd)
bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, const std::string& fullcmd)
{
char const* oldtext = text;
std::string cmd = "";
@@ -724,7 +724,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
return false;
}
bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand)
bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand)
{
std::string cmd = "";
@@ -879,7 +879,7 @@ Valid examples:
return LinkExtractor(message).IsValidMessage();
}
bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, char const* subcmd)
bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd)
{
std::string list;
for (uint32 i = 0; table[i].Name != NULL; ++i)
@@ -917,7 +917,7 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, ch
return true;
}
bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd)
bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
{
if (*cmd)
{
@@ -975,7 +975,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd)
}
//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
void ChatHandler::FillMessageData(WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker)
void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker)
{
uint32 messageLength = (message ? strlen(message) : 0) + 1;
@@ -1081,7 +1081,7 @@ Unit* ChatHandler::getSelectedUnit()
return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
}
WorldObject *ChatHandler::getSelectedObject()
WorldObject* ChatHandler::getSelectedObject()
{
if (!m_session)
return NULL;
+10 -10
View File
@@ -40,25 +40,25 @@ class ChatCommand
bool AllowConsole;
bool (*Handler)(ChatHandler*, const char* args);
std::string Help;
ChatCommand * ChildCommands;
ChatCommand* ChildCommands;
};
class ChatHandler
{
public:
WorldSession * GetSession() { return m_session; }
WorldSession* GetSession() { return m_session; }
explicit ChatHandler(WorldSession* session) : m_session(session) {}
explicit ChatHandler(Player* player) : m_session(player->GetSession()) {}
virtual ~ChatHandler() {}
static void FillMessageData(WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker);
static void FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker);
void FillMessageData(WorldPacket *data, uint8 type, uint32 language, uint64 target_guid, const char* message)
void FillMessageData(WorldPacket* data, uint8 type, uint32 language, uint64 target_guid, const char* message)
{
FillMessageData(data, m_session, type, language, NULL, target_guid, message, NULL);
}
void FillSystemMessageData(WorldPacket *data, const char* message)
void FillSystemMessageData(WorldPacket* data, const char* message)
{
FillMessageData(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, message);
}
@@ -126,10 +126,10 @@ class ChatHandler
protected:
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
static bool SetDataForCommandInTable(ChatCommand *table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand);
bool ExecuteCommandInTable(ChatCommand *table, const char* text, const std::string& fullcmd);
bool ShowHelpForCommand(ChatCommand *table, const char* cmd);
bool ShowHelpForSubCommands(ChatCommand *table, char const* cmd, char const* subcmd);
static bool SetDataForCommandInTable(ChatCommand* table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand);
bool ExecuteCommandInTable(ChatCommand* table, const char* text, const std::string& fullcmd);
bool ShowHelpForCommand(ChatCommand* table, const char* cmd);
bool ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd);
bool HandleNameAnnounceCommand(const char* args);
bool HandleGMNameAnnounceCommand(const char* args);
@@ -376,7 +376,7 @@ class ChatHandler
private:
bool _HandleGMTicketResponseAppendCommand(const char* args, bool newLine);
WorldSession * m_session; // != NULL for chat command call and NULL for CLI command
WorldSession* m_session; // != NULL for chat command call and NULL for CLI command
// common global flag
static bool load_command_table;
+6 -6
View File
@@ -165,7 +165,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss)
return true;
}
inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const *locale, char* const* suffixStrings) const
inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const
{
std::stringstream ss;
if (locale == NULL || index >= locale->Name.size())
@@ -186,7 +186,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context)
bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer);
if (!res)
{
ItemLocale const *il = sObjectMgr->GetItemLocale(_item->ItemId);
ItemLocale const* il = sObjectMgr->GetItemLocale(_item->ItemId);
for (uint8 index = LOCALE_koKR; index < TOTAL_LOCALES; ++index)
{
if (FormatName(index, il, suffixStrings) == buffer)
@@ -243,7 +243,7 @@ bool QuestChatLink::ValidateName(char* buffer, const char* context)
bool res = (_quest->GetTitle() == buffer);
if (!res)
if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(_quest->GetQuestId()))
if (QuestLocale const* ql = sObjectMgr->GetQuestLocale(_quest->GetQuestId()))
for (uint8 i = 0; i < ql->Title.size(); i++)
if (ql->Title[i] == buffer)
{
@@ -291,13 +291,13 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context)
sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for spell %u", context, _spell->Id);
return false;
}
SkillLineAbilityEntry const *skillInfo = bounds.first->second;
SkillLineAbilityEntry const* skillInfo = bounds.first->second;
if (!skillInfo)
{
sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id);
return false;
}
SkillLineEntry const *skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId);
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId);
if (!skillLine)
{
sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId);
@@ -457,7 +457,7 @@ bool TalentChatLink::Initialize(std::istringstream& iss)
return false;
}
// Validate talent
TalentEntry const *talentInfo = sTalentStore.LookupEntry(_talentId);
TalentEntry const* talentInfo = sTalentStore.LookupEntry(_talentId);
if (!talentInfo)
{
sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid talent id %u in |talent command", iss.str().c_str(), _talentId);
+2 -2
View File
@@ -54,7 +54,7 @@ bool ChatHandler::HandleCommandsCommand(const char* /*args*/)
bool ChatHandler::HandleStartCommand(const char* /*args*/)
{
Player *chr = m_session->GetPlayer();
Player* chr = m_session->GetPlayer();
if (chr->isInFlight())
{
@@ -131,7 +131,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
// save GM account without delay and output message
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
{
if (Player *target = getSelectedPlayer())
if (Player* target = getSelectedPlayer())
target->SaveToDB();
else
player->SaveToDB();
+8 -8
View File
@@ -311,14 +311,14 @@ bool ChatHandler::HandleAppearCommand(const char* args)
// if the player or the player's group is bound to another instance
// the player will not be bound to another one
InstancePlayerBind *pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(cMap->IsRaid()));
InstancePlayerBind* pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(cMap->IsRaid()));
if (!pBind)
{
Group* group = _player->GetGroup();
// if no bind exists, create a solo bind
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
if (!gBind)
if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
_player->BindToInstance(save, !save->CanReset());
}
@@ -421,7 +421,7 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
std::string argstr = (char*)args;
Player *chr = getSelectedPlayer();
Player* chr = getSelectedPlayer();
if (!chr)
{
chr=m_session->GetPlayer();
@@ -476,7 +476,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
// Search in AreaTable.dbc
for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows (); ++areaflag)
{
AreaTableEntry const *areaEntry = sAreaStore.LookupEntry (areaflag);
AreaTableEntry const* areaEntry = sAreaStore.LookupEntry (areaflag);
if (areaEntry)
{
int loc = GetSessionDbcLocale ();
@@ -686,7 +686,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
if (HasLowerSecurity(target, 0))
return false;
Group *grp = target->GetGroup();
Group* grp = target->GetGroup();
std::string nameLink = GetNameLink(target);
@@ -711,9 +711,9 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
return false;
}
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *pl = itr->getSource();
Player* pl = itr->getSource();
if (!pl || pl == m_session->GetPlayer() || !pl->GetSession())
continue;
+11 -11
View File
@@ -298,7 +298,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
if (!result)
return false;
Field *fields = result->Fetch();
Field* fields = result->Fetch();
total_player_time = fields[0].GetUInt32();
level = fields[1].GetUInt32();
money = fields[2].GetUInt32();
@@ -352,7 +352,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
if (QueryResult result = LoginDatabase.PQuery("SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned "
"WHERE id = '%u' AND active ORDER BY bandate ASC LIMIT 1", accId))
{
Field * fields = result->Fetch();
Field* fields = result->Fetch();
banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64();
bannedby = fields[2].GetString();
banreason = fields[3].GetString();
@@ -360,7 +360,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
else if (QueryResult result = CharacterDatabase.PQuery("SELECT unbandate, bandate = unbandate, bannedby, banreason FROM character_banned "
"WHERE guid = '%u' AND active ORDER BY bandate ASC LIMIT 1", GUID_LOPART(target_guid)))
{
Field * fields = result->Fetch();
Field* fields = result->Fetch();
banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64();
bannedby = fields[2].GetString();
banreason = fields[3].GetString();
@@ -563,7 +563,7 @@ bool ChatHandler::HandleCharacterReputationCommand(const char* args)
for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
{
const FactionState& faction = itr->second;
FactionEntry const *factionEntry = sFactionStore.LookupEntry(faction.ID);
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
@@ -834,7 +834,7 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
{
Player* player = m_session->GetPlayer();
Creature *creatureTarget = getSelectedCreature();
Creature* creatureTarget = getSelectedCreature();
if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
{
@@ -912,8 +912,8 @@ bool ChatHandler::HandlePetLearnCommand(const char* args)
if (!*args)
return false;
Player *plr = m_session->GetPlayer();
Pet *pet = plr->GetPet();
Player* plr = m_session->GetPlayer();
Pet* pet = plr->GetPet();
if (!pet)
{
@@ -955,8 +955,8 @@ bool ChatHandler::HandlePetUnlearnCommand(const char *args)
if (!*args)
return false;
Player *plr = m_session->GetPlayer();
Pet *pet = plr->GetPet();
Player* plr = m_session->GetPlayer();
Pet* pet = plr->GetPet();
if (!pet)
{
@@ -1001,7 +1001,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
// Search in CharTitles.dbc
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
{
CharTitlesEntry const *titleInfo = sCharTitlesStore.LookupEntry(id);
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo)
{
int loc = GetSessionDbcLocale();
@@ -1074,7 +1074,7 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
// Search in CharTitles.dbc
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
{
CharTitlesEntry const *titleInfo = sCharTitlesStore.LookupEntry(id);
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo && target->HasTitle(titleInfo))
{
std::string name = titleInfo->name[loc];
+39 -39
View File
@@ -263,7 +263,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
sLog->outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(itemId);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemId);
if (!pProto)
{
PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
@@ -435,7 +435,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 item_guid = fields[0].GetUInt32();
uint32 item_bag = fields[1].GetUInt32();
uint32 item_slot = fields[2].GetUInt32();
@@ -490,7 +490,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 item_guid = fields[0].GetUInt32();
uint32 item_s = fields[1].GetUInt32();
uint32 item_r = fields[2].GetUInt32();
@@ -535,7 +535,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 item_guid = fields[0].GetUInt32();
uint32 owner = fields[1].GetUInt32();
uint32 owner_acc = fields[2].GetUInt32();
@@ -566,7 +566,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 item_guid = fields[0].GetUInt32();
uint32 guild_guid = fields[1].GetUInt32();
std::string guild_name = fields[2].GetString();
@@ -649,7 +649,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
@@ -721,7 +721,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args)
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
@@ -765,7 +765,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args)
if (loc_idx >= 0)
{
uint8 uloc_idx = uint8(loc_idx);
if (ItemLocale const *il = sObjectMgr->GetItemLocale(itr->second.ItemId))
if (ItemLocale const* il = sObjectMgr->GetItemLocale(itr->second.ItemId))
{
if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty())
{
@@ -842,7 +842,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args)
// Search in ItemSet.dbc
for (uint32 id = 0; id < sItemSetStore.GetNumRows(); id++)
{
ItemSetEntry const *set = sItemSetStore.LookupEntry(id);
ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
if (set)
{
int loc = GetSessionDbcLocale();
@@ -915,7 +915,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args)
// Search in SkillLine.dbc
for (uint32 id = 0; id < sSkillLineStore.GetNumRows(); id++)
{
SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(id);
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
if (skillInfo)
{
int loc = GetSessionDbcLocale();
@@ -1002,7 +1002,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args)
// Search in Spell.dbc
for (uint32 id = 0; id < sSpellMgr->GetSpellInfoStoreSize(); id++)
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(id);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
if (spellInfo)
{
int loc = GetSessionDbcLocale();
@@ -1119,7 +1119,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
if (loc_idx >= 0)
{
uint8 uloc_idx = uint8(loc_idx);
if (QuestLocale const *il = sObjectMgr->GetQuestLocale(qinfo->GetQuestId()))
if (QuestLocale const* il = sObjectMgr->GetQuestLocale(qinfo->GetQuestId()))
{
if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty())
{
@@ -1232,7 +1232,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
{
uint32 id = itr->second.Entry;
uint8 localeIndex = GetSessionDbLocaleIndex();
if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(id))
if (CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(id))
{
if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ())
{
@@ -1309,7 +1309,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
{
uint8 localeIndex = GetSessionDbLocaleIndex();
if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(itr->second.entry))
if (GameObjectLocale const* gl = sObjectMgr->GetGameObjectLocale(itr->second.entry))
{
if (gl->Name.size() > localeIndex && !gl->Name[localeIndex].empty())
{
@@ -1370,7 +1370,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args)
return false;
// Can be NULL at console call
Player *target = getSelectedPlayer ();
Player* target = getSelectedPlayer ();
std::string namepart = args;
std::wstring wnamepart;
@@ -1387,7 +1387,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args)
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
{
FactionEntry const *factionEntry = sFactionStore.LookupEntry (id);
FactionEntry const* factionEntry = sFactionStore.LookupEntry (id);
if (factionEntry)
{
FactionState const* repState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
@@ -1487,7 +1487,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
// Search in TaxiNodes.dbc
for (uint32 id = 0; id < sTaxiNodesStore.GetNumRows(); id++)
{
TaxiNodesEntry const *nodeEntry = sTaxiNodesStore.LookupEntry(id);
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id);
if (nodeEntry)
{
int loc = GetSessionDbcLocale();
@@ -1957,7 +1957,7 @@ bool ChatHandler::HandleAuraCommand(const char *args)
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellID = extractSpellIdFromLink((char*)args);
if (SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellID))
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID))
Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target);
return true;
@@ -2027,7 +2027,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args)
uint32 zoneId = player->GetZoneId();
AreaTableEntry const *areaEntry = GetAreaEntryByAreaID(zoneId);
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
if (!areaEntry || areaEntry->zone !=0)
{
PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, g_id, zoneId);
@@ -2116,7 +2116,7 @@ bool ChatHandler::HandleExploreCheatCommand(const char *args)
int flag = atoi((char*)args);
Player *chr = getSelectedPlayer();
Player* chr = getSelectedPlayer();
if (chr == NULL)
{
SendSysMessage(LANG_NO_CHAR_SELECTED);
@@ -2282,7 +2282,7 @@ bool ChatHandler::HandleShowAreaCommand(const char *args)
if (!*args)
return false;
Player *chr = getSelectedPlayer();
Player* chr = getSelectedPlayer();
if (chr == NULL)
{
SendSysMessage(LANG_NO_CHAR_SELECTED);
@@ -2313,7 +2313,7 @@ bool ChatHandler::HandleHideAreaCommand(const char *args)
if (!*args)
return false;
Player *chr = getSelectedPlayer();
Player* chr = getSelectedPlayer();
if (chr == NULL)
{
SendSysMessage(LANG_NO_CHAR_SELECTED);
@@ -2390,7 +2390,7 @@ bool ChatHandler::HandleChangeWeather(const char *args)
bool ChatHandler::HandleListAurasCommand (const char * /*args*/)
{
Unit *unit = getSelectedUnit();
Unit* unit = getSelectedUnit();
if (!unit)
{
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
@@ -3177,7 +3177,7 @@ bool ChatHandler::HandleBanInfoIPCommand(const char *args)
return true;
}
Field *fields = result->Fetch();
Field* fields = result->Fetch();
bool permanent = !fields[6].GetUInt64();
PSendSysMessage(LANG_BANINFO_IPENTRY,
fields[0].GetCString(), fields[1].GetCString(), permanent ? GetTrinityString(LANG_BANINFO_NEVER) : fields[2].GetCString(),
@@ -3332,7 +3332,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result)
do
{
SendSysMessage("-------------------------------------------------------------------------------");
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 account_id = fields[0].GetUInt32 ();
std::string account_name;
@@ -3348,7 +3348,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result)
QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
if (banInfo)
{
Field *fields2 = banInfo->Fetch();
Field* fields2 = banInfo->Fetch();
do
{
time_t t_ban = fields2[0].GetUInt64();
@@ -3425,7 +3425,7 @@ bool ChatHandler::HandleBanListIPCommand(const char *args)
do
{
SendSysMessage("-------------------------------------------------------------------------------");
Field *fields = result->Fetch();
Field* fields = result->Fetch();
time_t t_ban = fields[1].GetUInt64();
tm* aTm_ban = localtime(&t_ban);
if (fields[1].GetUInt64() == fields[2].GetUInt64())
@@ -4091,7 +4091,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
{
InstanceSave *save = itr->second.save;
InstanceSave* save = itr->second.save;
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
counter++;
@@ -4107,7 +4107,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i));
for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
{
InstanceSave *save = itr->second.save;
InstanceSave* save = itr->second.save;
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
counter++;
@@ -4148,7 +4148,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
{
InstanceSave *save = itr->second.save;
InstanceSave* save = itr->second.save;
if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
{
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
@@ -4391,7 +4391,7 @@ bool ChatHandler::HandleSendMoneyCommand(const char *args)
bool ChatHandler::HandleSendMessageCommand(const char *args)
{
///- Find the player
Player *rPlayer;
Player* rPlayer;
if (!extractPlayerTarget((char*)args, &rPlayer))
return false;
@@ -4435,7 +4435,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
return false;
Player* player = m_session->GetPlayer();
Channel *chn = NULL;
Channel* chn = NULL;
if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
chn = cMgr->GetChannel(channel, player);
@@ -4540,7 +4540,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
//if player class = hunter || warlock remove pet if alive
if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
{
if (Pet *pet = player->GetPet())
if (Pet* pet = player->GetPet())
{
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
// not let dismiss dead pet
@@ -4550,7 +4550,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
}
//m_session->GetPlayer()->CastSpell(player, spellID, false);
if (SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(9454))
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454))
Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player);
//save player
@@ -4606,7 +4606,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
return true;
}
//if player found: delete his freeze aura
Field *fields=result->Fetch();
Field* fields=result->Fetch();
uint64 pguid = fields[0].GetUInt64();
CharacterDatabase.PQuery("DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = '%u'", pguid);
@@ -4638,7 +4638,7 @@ bool ChatHandler::HandleListFreezeCommand(const char * /*args*/)
//Output of the results
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
std::string fplayers = fields[0].GetString();
PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, fplayers.c_str());
} while (result->NextRow());
@@ -4693,7 +4693,7 @@ bool ChatHandler::HandleGroupRemoveCommand(const char *args)
bool ChatHandler::HandlePossessCommand(const char * /*args*/)
{
Unit *pUnit = getSelectedUnit();
Unit* pUnit = getSelectedUnit();
if (!pUnit)
return false;
@@ -4703,7 +4703,7 @@ bool ChatHandler::HandlePossessCommand(const char * /*args*/)
bool ChatHandler::HandleUnPossessCommand(const char * /*args*/)
{
Unit *pUnit = getSelectedUnit();
Unit* pUnit = getSelectedUnit();
if (!pUnit)
pUnit = m_session->GetPlayer();
@@ -4714,7 +4714,7 @@ bool ChatHandler::HandleUnPossessCommand(const char * /*args*/)
bool ChatHandler::HandleBindSightCommand(const char * /*args*/)
{
Unit *pUnit = getSelectedUnit();
Unit* pUnit = getSelectedUnit();
if (!pUnit)
return false;
+2 -2
View File
@@ -142,7 +142,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction)
//=================================================
// delete one reference, defined by Unit
void HostileRefManager::deleteReference(Unit *creature)
void HostileRefManager::deleteReference(Unit* creature)
{
HostileReference* ref = getFirst();
while (ref)
@@ -161,7 +161,7 @@ void HostileRefManager::deleteReference(Unit *creature)
//=================================================
// set state for one reference, defined by Unit
void HostileRefManager::setOnlineOfflineState(Unit *creature, bool isOnline)
void HostileRefManager::setOnlineOfflineState(Unit* creature, bool isOnline)
{
HostileReference* ref = getFirst();
while (ref)
+4 -4
View File
@@ -283,7 +283,7 @@ HostileReference* ThreatContainer::addThreat(Unit* victim, float threat)
//============================================================
void ThreatContainer::modifyThreatPercent(Unit *victim, int32 percent)
void ThreatContainer::modifyThreatPercent(Unit* victim, int32 percent)
{
if (HostileReference* ref = getReferenceByTarget(victim))
ref->addThreatPercent(percent);
@@ -394,7 +394,7 @@ void ThreatManager::clearReferences()
//============================================================
void ThreatManager::addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask, SpellInfo const *threatSpell)
void ThreatManager::addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell)
{
if (!ThreatCalcHelper::isValidProcess(victim, getOwner(), threatSpell))
return;
@@ -460,7 +460,7 @@ Unit* ThreatManager::getHostilTarget()
//============================================================
float ThreatManager::getThreat(Unit *victim, bool alsoSearchOfflineList)
float ThreatManager::getThreat(Unit* victim, bool alsoSearchOfflineList)
{
float threat = 0.0f;
HostileReference* ref = iThreatContainer.getReferenceByTarget(victim);
@@ -485,7 +485,7 @@ void ThreatManager::tauntApply(Unit* taunter)
//============================================================
void ThreatManager::tauntFadeOut(Unit *taunter)
void ThreatManager::tauntFadeOut(Unit* taunter)
{
HostileReference* ref = iThreatContainer.getReferenceByTarget(taunter);
if (ref)
+6 -6
View File
@@ -160,7 +160,7 @@ class ThreatContainer
HostileReference* addThreat(Unit* victim, float threat);
void modifyThreatPercent(Unit *victim, int32 percent);
void modifyThreatPercent(Unit* victim, int32 percent);
HostileReference* selectNextVictim(Creature* attacker, HostileReference* currentVictim);
@@ -184,7 +184,7 @@ class ThreatManager
public:
friend class HostileReference;
explicit ThreatManager(Unit *owner);
explicit ThreatManager(Unit* owner);
~ThreatManager() { clearReferences(); }
@@ -194,9 +194,9 @@ class ThreatManager
void doAddThreat(Unit* victim, float threat);
void modifyThreatPercent(Unit *victim, int32 percent);
void modifyThreatPercent(Unit* victim, int32 percent);
float getThreat(Unit *victim, bool alsoSearchOfflineList = false);
float getThreat(Unit* victim, bool alsoSearchOfflineList = false);
bool isThreatListEmpty() { return iThreatContainer.empty(); }
@@ -211,7 +211,7 @@ class ThreatManager
Unit* getHostilTarget();
void tauntApply(Unit* taunter);
void tauntFadeOut(Unit *taunter);
void tauntFadeOut(Unit* taunter);
void setCurrentVictim(HostileReference* hostileRef);
@@ -246,7 +246,7 @@ class ThreatManager
ThreatContainer& getOnlineContainer() { return iThreatContainer; }
ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
private:
void _addThreat(Unit *victim, float threat);
void _addThreat(Unit* victim, float threat);
HostileReference* iCurrentVictim;
Unit* iOwner;
+7 -7
View File
@@ -113,7 +113,7 @@ bool Condition::Meets(Player* player, Unit* invoker)
break;
case CONDITION_INSTANCE_DATA:
{
Map *map = player->GetMap();
Map* map = player->GetMap();
if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceScript())
condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(mConditionValue1) == mConditionValue2;
break;
@@ -392,7 +392,7 @@ void ConditionMgr::LoadConditions(bool isReload)
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
Condition* cond = new Condition();
int32 iSourceTypeOrReferenceId = fields[0].GetInt32();
@@ -933,7 +933,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
return false;
}
ItemTemplate const *pItemProto = sObjectMgr->GetItemTemplate(cond->mSourceEntry);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->mSourceEntry);
if (!pItemProto)
{
sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->mSourceEntry);
@@ -1041,7 +1041,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_ITEM:
{
ItemTemplate const *proto = sObjectMgr->GetItemTemplate(cond->mConditionValue1);
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->mConditionValue1);
if (!proto)
{
sLog->outErrorDb("Item condition has non existing item (%u), skipped", cond->mConditionValue1);
@@ -1057,7 +1057,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_ITEM_EQUIPPED:
{
ItemTemplate const *proto = sObjectMgr->GetItemTemplate(cond->mConditionValue1);
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->mConditionValue1);
if (!proto)
{
sLog->outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->mConditionValue1);
@@ -1111,7 +1111,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_SKILL:
{
SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(cond->mConditionValue1);
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(cond->mConditionValue1);
if (!pSkill)
{
sLog->outErrorDb("Skill condition specifies non-existing skill (%u), skipped", cond->mConditionValue1);
@@ -1323,7 +1323,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_NOITEM:
{
ItemTemplate const *proto = sObjectMgr->GetItemTemplate(cond->mConditionValue1);
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->mConditionValue1);
if (!proto)
{
sLog->outErrorDb("NoItem condition has non existing item (%u), skipped", cond->mConditionValue1);
+6 -6
View File
@@ -46,7 +46,7 @@ struct WMOAreaTableTripple
int32 adtId;
};
typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const *> WMOAreaInfoByTripple;
typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
@@ -397,7 +397,7 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
{
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
if (!skillLine)
continue;
@@ -443,7 +443,7 @@ void LoadDBCStores(const std::string& dataPath)
// Create Spelldifficulty searcher
for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i)
{
SpellDifficultyEntry const *spellDiff = sSpellDifficultyStore.LookupEntry(i);
SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(i);
if (!spellDiff)
continue;
@@ -470,7 +470,7 @@ void LoadDBCStores(const std::string& dataPath)
// create talent spells set
for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
{
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
if (!talentInfo) continue;
for (int j = 0; j < MAX_TALENT_RANK; j++)
if (talentInfo->RankID[j])
@@ -484,7 +484,7 @@ void LoadDBCStores(const std::string& dataPath)
// now have all max ranks (and then bit amount used for store talent ranks in inspect)
for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
{
TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry(talentTabId);
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentTabId);
if (!talentTabInfo)
continue;
@@ -649,7 +649,7 @@ char* GetPetName(uint32 petfamily, uint32 dbclang)
{
if (!petfamily)
return NULL;
CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
if (!pet_family)
return NULL;
return pet_family->Name[dbclang]?pet_family->Name[dbclang]:NULL;
+1 -1
View File
@@ -228,7 +228,7 @@ void LFGMgr::Update(uint32 diff)
SetState(guid, LFG_STATE_PROPOSAL);
if (Player* plr = ObjectAccessor::FindPlayer(itPlayers->first))
{
Group *grp = plr->GetGroup();
Group* grp = plr->GetGroup();
if (grp)
{
uint64 gguid = grp->GetGUID();
@@ -37,9 +37,9 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid)
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_CLEAR_LOCK_LIST);
for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
if (Player *plrg = itr->getSource())
if (Player* plrg = itr->getSource())
{
plrg->GetSession()->SendLfgUpdatePlayer(updateData);
plrg->GetSession()->SendLfgUpdateParty(updateData);
@@ -51,7 +51,7 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid)
sLFGMgr->Leave(NULL, group);
if (sLFGMgr->GetState(guid) == LFG_STATE_QUEUED)
if (Player *plr = ObjectAccessor::FindPlayer(guid))
if (Player* plr = ObjectAccessor::FindPlayer(guid))
sLFGMgr->Leave(plr);
}
@@ -82,7 +82,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method,
}
sLFGMgr->ClearState(guid);
if (Player *plr = ObjectAccessor::FindPlayer(guid))
if (Player* plr = ObjectAccessor::FindPlayer(guid))
{
/*
if (method == GROUP_REMOVEMETHOD_LEAVE)
@@ -116,7 +116,7 @@ void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLe
return;
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid);
Player *plr = ObjectAccessor::FindPlayer(newLeaderGuid);
Player* plr = ObjectAccessor::FindPlayer(newLeaderGuid);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER);
if (plr)
+3 -3
View File
@@ -66,14 +66,14 @@ void Corpse::RemoveFromWorld()
Object::RemoveFromWorld();
}
bool Corpse::Create(uint32 guidlow, Map *map)
bool Corpse::Create(uint32 guidlow, Map* map)
{
SetMap(map);
Object::_Create(guidlow, 0, HIGHGUID_CORPSE);
return true;
}
bool Corpse::Create(uint32 guidlow, Player *owner)
bool Corpse::Create(uint32 guidlow, Player* owner)
{
ASSERT(owner);
@@ -162,7 +162,7 @@ void Corpse::DeleteFromDB(SQLTransaction& trans)
trans->Append(stmt);
}
bool Corpse::LoadFromDB(uint32 guid, Field *fields)
bool Corpse::LoadFromDB(uint32 guid, Field* fields)
{
uint32 ownerGuid = fields[17].GetUInt32();
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
+3 -3
View File
@@ -55,11 +55,11 @@ class Corpse : public WorldObject, public GridObject<Corpse>
void AddToWorld();
void RemoveFromWorld();
bool Create(uint32 guidlow, Map *map);
bool Create(uint32 guidlow, Player *owner);
bool Create(uint32 guidlow, Map* map);
bool Create(uint32 guidlow, Player* owner);
void SaveToDB();
bool LoadFromDB(uint32 guid, Field *fields);
bool LoadFromDB(uint32 guid, Field* fields);
void DeleteBonesFromWorld();
void DeleteFromDB(SQLTransaction& trans);
+39 -39
View File
@@ -253,9 +253,9 @@ void Creature::RemoveCorpse(bool setSpawnTime)
/**
* change the entry of creature until respawn
*/
bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data)
bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data)
{
CreatureTemplate const *normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!normalInfo)
{
sLog->outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
@@ -263,7 +263,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
}
// get difficulty 1 mode entry
CreatureTemplate const *cinfo = normalInfo;
CreatureTemplate const* cinfo = normalInfo;
for (uint8 diff = uint8(GetMap()->GetSpawnMode()); diff > 0;)
{
// we already have valid Map pointer for current creature!
@@ -301,7 +301,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
}
uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data);
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (!minfo) // Cancel load if no model defined
{
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
@@ -343,7 +343,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
return true;
}
bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
{
if (!InitEntry(Entry, team, data))
return false;
@@ -691,7 +691,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
return false;
}
UnitAI *oldAI = i_AI;
UnitAI* oldAI = i_AI;
Motion_Initialize();
@@ -720,13 +720,13 @@ void Creature::Motion_Initialize()
i_motionMaster.Initialize();
}
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData *data)
bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data)
{
ASSERT(map);
SetMap(map);
SetPhaseMask(phaseMask, false);
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(Entry);
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog->outErrorDb("Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
@@ -766,7 +766,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
LoadCreaturesAddon();
uint32 displayID = GetNativeDisplayId();
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (minfo && !isTotem()) // Cancel load if no model defined or if totem
{
SetDisplayId(displayID);
@@ -953,21 +953,21 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint3
SendMonsterMove(x, y, z, time);
}
Player *Creature::GetLootRecipient() const
Player* Creature::GetLootRecipient() const
{
if (!m_lootRecipient)
return NULL;
return ObjectAccessor::FindPlayer(m_lootRecipient);
}
Group *Creature::GetLootRecipientGroup() const
Group* Creature::GetLootRecipientGroup() const
{
if (!m_lootRecipientGroup)
return NULL;
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
}
void Creature::SetLootRecipient(Unit *unit)
void Creature::SetLootRecipient(Unit* unit)
{
// set the player whose group should receive the right
// to loot the creature after it dies
@@ -1012,7 +1012,7 @@ void Creature::SaveToDB()
{
// this should only be used when the creature has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
CreatureData const *data = sObjectMgr->GetCreatureData(m_DBTableGuid);
CreatureData const* data = sObjectMgr->GetCreatureData(m_DBTableGuid);
if (!data)
{
sLog->outError("Creature::SaveToDB failed, cannot get creature data!");
@@ -1035,7 +1035,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
uint32 dynamicflags = GetUInt32Value(UNIT_DYNAMIC_FLAGS);
// check if it's a custom model and if not, use 0 for displayId
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
if (cinfo)
{
if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
@@ -1109,7 +1109,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabase.CommitTransaction(trans);
}
void Creature::SelectLevel(const CreatureTemplate *cinfo)
void Creature::SelectLevel(const CreatureTemplate* cinfo)
{
uint32 rank = isPet()? 0 : cinfo->rank;
@@ -1214,7 +1214,7 @@ float Creature::GetSpellDamageMod(int32 Rank)
}
}
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData *data)
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data)
{
SetZoneScript();
if (m_zoneScript && data)
@@ -1224,7 +1224,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
return false;
}
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(Entry);
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog->outErrorDb("Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
@@ -1247,7 +1247,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
return true;
}
bool Creature::LoadFromDB(uint32 guid, Map *map)
bool Creature::LoadFromDB(uint32 guid, Map* map)
{
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
@@ -1332,7 +1332,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
return;
}
EquipmentInfo const *einfo = sObjectMgr->GetEquipmentInfo(equip_entry);
EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(equip_entry);
if (!einfo)
return;
@@ -1524,7 +1524,7 @@ void Creature::setDeathState(DeathState s)
SetFullHealth();
SetLootRecipient(NULL);
ResetPlayerDamageReq();
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
if (GetCreatureInfo()->InhabitType & INHABIT_AIR)
AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
@@ -1586,13 +1586,13 @@ void Creature::Respawn(bool force)
if (m_originalEntry != GetEntry())
UpdateEntry(m_originalEntry);
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
SelectLevel(cinfo);
setDeathState(JUST_ALIVED);
uint32 displayID = GetNativeDisplayId();
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (minfo) // Cancel load if no model defined
{
SetDisplayId(displayID);
@@ -1621,7 +1621,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn)
{
if (timeMSToDespawn)
{
ForcedDespawnDelayEvent *pEvent = new ForcedDespawnDelayEvent(*this);
ForcedDespawnDelayEvent* pEvent = new ForcedDespawnDelayEvent(*this);
m_Events.AddEvent(pEvent, m_Events.CalculateTime(timeMSToDespawn));
return;
@@ -1663,7 +1663,7 @@ bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index)
return Unit::IsImmunedToSpellEffect(spellInfo, index);
}
SpellInfo const *Creature::reachWithSpellAttack(Unit *pVictim)
SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim)
{
if (!pVictim)
return NULL;
@@ -1672,7 +1672,7 @@ SpellInfo const *Creature::reachWithSpellAttack(Unit *pVictim)
{
if (!m_spells[i])
continue;
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
@@ -1710,7 +1710,7 @@ SpellInfo const *Creature::reachWithSpellAttack(Unit *pVictim)
return NULL;
}
SpellInfo const *Creature::reachWithSpellCure(Unit *pVictim)
SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim)
{
if (!pVictim)
return NULL;
@@ -1719,7 +1719,7 @@ SpellInfo const *Creature::reachWithSpellCure(Unit *pVictim)
{
if (!m_spells[i])
continue;
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
@@ -1864,7 +1864,7 @@ void Creature::CallAssistance()
if (!assistList.empty())
{
AssistDelayEvent *e = new AssistDelayEvent(getVictim()->GetGUID(), *this);
AssistDelayEvent* e = new AssistDelayEvent(getVictim()->GetGUID(), *this);
while (!assistList.empty())
{
// Pushing guids because in delay can happen some creature gets despawned => invalid pointer
@@ -1960,7 +1960,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const
return false;
}
const Unit *myVictim = getAttackerForHelper();
const Unit* myVictim = getAttackerForHelper();
const Unit* targetVictim = target->getAttackerForHelper();
// if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
@@ -1984,7 +1984,7 @@ void Creature::SaveRespawnTime()
}
// this should not be called by petAI or
bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
bool Creature::canCreatureAttack(Unit const* pVictim, bool force) const
{
if (!pVictim->IsInMap(this))
return false;
@@ -2004,7 +2004,7 @@ bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
float dist = std::max(GetAttackDistance(pVictim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance;
if (Unit *unit = GetCharmerOrOwner())
if (Unit* unit = GetCharmerOrOwner())
return pVictim->IsWithinDist(unit, dist);
else
return pVictim->IsInDist(&m_homePosition, dist);
@@ -2025,7 +2025,7 @@ CreatureAddon const* Creature::GetCreatureAddon() const
//creature_addon table
bool Creature::LoadCreaturesAddon(bool reload)
{
CreatureAddon const *cainfo = GetCreatureAddon();
CreatureAddon const* cainfo = GetCreatureAddon();
if (!cainfo)
return false;
@@ -2072,7 +2072,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
{
for (std::vector<uint32>::const_iterator itr = cainfo->auras.begin(); itr != cainfo->auras.end(); ++itr)
{
SpellInfo const *AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
if (!AdditionalSpellInfo)
{
sLog->outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
@@ -2155,12 +2155,12 @@ void Creature::_AddCreatureCategoryCooldown(uint32 category, time_t apply_time)
void Creature::AddCreatureSpellCooldown(uint32 spellid)
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellid);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
return;
uint32 cooldown = spellInfo->GetRecoveryTime();
if (Player *modOwner = GetSpellModOwner())
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellid, SPELLMOD_COOLDOWN, cooldown);
if (cooldown)
@@ -2172,7 +2172,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
bool Creature::HasCategoryCooldown(uint32 spell_id) const
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
if (!spellInfo)
return false;
@@ -2240,7 +2240,7 @@ void Creature::AllLootRemovedFromCorpse()
return;
float decayRate;
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
@@ -2371,7 +2371,7 @@ const char* Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
if (loc_idx != DEFAULT_LOCALE)
{
uint8 uloc_idx = uint8(loc_idx);
CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(GetEntry());
CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(GetEntry());
if (cl)
{
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
@@ -2401,6 +2401,6 @@ void Creature::FarTeleportTo(Map* map, float X, float Y, float Z, float O)
bool Creature::IsDungeonBoss() const
{
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS);
}
+14 -14
View File
@@ -419,9 +419,9 @@ class Creature : public Unit, public GridObject<Creature>
void DisappearAndDie();
bool Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData *data = NULL);
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data = NULL);
bool LoadCreaturesAddon(bool reload = false);
void SelectLevel(const CreatureTemplate *cinfo);
void SelectLevel(const CreatureTemplate* cinfo);
void LoadEquipment(uint32 equip_entry, bool force=false);
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
@@ -457,7 +457,7 @@ class Creature : public Unit, public GridObject<Creature>
bool isCanTrainingOf(Player* player, bool msg) const;
bool isCanInteractWithBattleMaster(Player* player, bool msg) const;
bool isCanTrainingAndResetTalentsOf(Player* pPlayer) const;
bool canCreatureAttack(Unit const *pVictim, bool force = true) const;
bool canCreatureAttack(Unit const* pVictim, bool force = true) const;
bool IsImmunedToSpell(SpellInfo const* spellInfo);
// redefine Unit::IsImmunedToSpell
bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const;
@@ -489,7 +489,7 @@ class Creature : public Unit, public GridObject<Creature>
void Motion_Initialize();
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type);
CreatureAI * AI() const { return (CreatureAI*)i_AI; }
CreatureAI* AI() const { return (CreatureAI*)i_AI; }
uint32 GetShieldBlockValue() const //dunno mob block value
{
@@ -526,8 +526,8 @@ class Creature : public Unit, public GridObject<Creature>
TrainerSpellData const* GetTrainerSpells() const;
CreatureTemplate const *GetCreatureInfo() const { return m_creatureInfo; }
CreatureData const *GetCreatureData() const { return m_creatureData; }
CreatureTemplate const* GetCreatureInfo() const { return m_creatureInfo; }
CreatureData const* GetCreatureData() const { return m_creatureData; }
CreatureAddon const* GetCreatureAddon() const;
std::string GetAIName() const;
@@ -546,7 +546,7 @@ class Creature : public Unit, public GridObject<Creature>
void setDeathState(DeathState s); // override virtual Unit::setDeathState
bool FallGround();
bool LoadFromDB(uint32 guid, Map *map);
bool LoadFromDB(uint32 guid, Map* map);
void SaveToDB();
// overriden in Pet
virtual void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
@@ -570,8 +570,8 @@ class Creature : public Unit, public GridObject<Creature>
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
SpellInfo const *reachWithSpellAttack(Unit *pVictim);
SpellInfo const *reachWithSpellCure(Unit *pVictim);
SpellInfo const* reachWithSpellAttack(Unit* pVictim);
SpellInfo const* reachWithSpellCure(Unit* pVictim);
uint32 m_spells[CREATURE_MAX_SPELLS];
CreatureSpellCooldowns m_CreatureSpellCooldowns;
@@ -651,10 +651,10 @@ class Creature : public Unit, public GridObject<Creature>
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
void SearchFormation();
CreatureGroup *GetFormation() {return m_formation;}
void SetFormation(CreatureGroup *formation) {m_formation = formation;}
CreatureGroup* GetFormation() {return m_formation;}
void SetFormation(CreatureGroup* formation) {m_formation = formation;}
Unit *SelectVictim();
Unit* SelectVictim();
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
@@ -679,7 +679,7 @@ class Creature : public Unit, public GridObject<Creature>
void FarTeleportTo(Map* map, float X, float Y, float Z, float O);
protected:
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData *data = NULL);
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data = NULL);
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
// vendor items
@@ -733,7 +733,7 @@ class Creature : public Unit, public GridObject<Creature>
uint32 m_path_id;
//Formation var
CreatureGroup *m_formation;
CreatureGroup* m_formation;
bool TriggerJustRespawned;
};
@@ -28,7 +28,7 @@ CreatureGroupInfoType CreatureGroupMap;
void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature* member)
{
Map *map = member->FindMap();
Map* map = member->FindMap();
if (!map)
return;
@@ -57,7 +57,7 @@ void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup* group, Creatur
if (group->isEmpty())
{
Map *map = member->FindMap();
Map* map = member->FindMap();
if (!map)
return;
@@ -92,7 +92,7 @@ void CreatureGroupManager::LoadCreatureFormations()
{
do
{
Field *fields = guidResult->Fetch();
Field* fields = guidResult->Fetch();
uint32 guid = fields[0].GetUInt32();
guidSet.insert(guid);
@@ -101,8 +101,8 @@ void CreatureGroupManager::LoadCreatureFormations()
}
uint32 count = 0;
Field *fields;
FormationInfo *group_member;
Field* fields;
FormationInfo* group_member;
do
{
@@ -35,8 +35,8 @@ class CreatureGroupManager
{
friend class ACE_Singleton<CreatureGroupManager, ACE_Null_Mutex>;
public:
void AddCreatureToGroup(uint32 group_id, Creature *creature);
void RemoveCreatureFromGroup(CreatureGroup* group, Creature *creature);
void AddCreatureToGroup(uint32 group_id, Creature* creature);
void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature);
void LoadCreatureFormations();
};
@@ -49,7 +49,7 @@ extern CreatureGroupInfoType CreatureGroupMap;
class CreatureGroup
{
private:
Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
typedef std::map<Creature*, FormationInfo*> CreatureGroupMemberType;
CreatureGroupMemberType m_members;
@@ -109,7 +109,7 @@ void GossipMenu::ClearMenu()
_menuItemData.clear();
}
PlayerMenu::PlayerMenu(WorldSession *session) : _session(session)
PlayerMenu::PlayerMenu(WorldSession* session) : _session(session)
{
}
@@ -187,7 +187,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poiId) const
std::string iconText = poi->icon_name;
int32 locale = _session->GetSessionDbLocaleIndex();
if (locale >= 0)
if (PointOfInterestLocale const *localeData = sObjectMgr->GetPointOfInterestLocale(poiId))
if (PointOfInterestLocale const* localeData = sObjectMgr->GetPointOfInterestLocale(poiId))
ObjectMgr::GetLocaleString(localeData->IconName, locale, iconText);
WorldPacket data(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 10); // guess size
@@ -261,13 +261,13 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
uint32 questID = qmi.QuestId;
if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(questID))
if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questID))
{
std::string title = pQuest->GetTitle();
int loc_idx = _session->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(questID))
if (QuestLocale const* ql = sObjectMgr->GetQuestLocale(questID))
ObjectMgr::GetLocaleString(ql->Title, loc_idx, title);
data << uint32(questID);
@@ -294,7 +294,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus);
}
void PlayerMenu::SendQuestGiverQuestDetails(Quest const *quest, uint64 npcGUID, bool activateAccept) const
void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const
{
std::string questTitle = quest->GetTitle();
std::string questDetails = quest->GetDetails();
@@ -624,7 +624,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
}
void PlayerMenu::SendQuestGiverRequestItems(Quest const *quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const
void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const
{
// We can always call to RequestItems, but this packet only goes out if there are actually
// items. Otherwise, we'll skip straight to the OfferReward
@@ -272,10 +272,10 @@ class PlayerMenu
void SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID);
void SendQuestQueryResponse(Quest const* quest) const;
void SendQuestGiverQuestDetails(Quest const *quest, uint64 npcGUID, bool activateAccept) const;
void SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const;
void SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const;
void SendQuestGiverRequestItems(Quest const *quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const;
void SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const;
private:
GossipMenu _gossipMenu;
@@ -22,7 +22,7 @@
#include "ObjectMgr.h"
#include "TemporarySummon.h"
TempSummon::TempSummon(SummonPropertiesEntry const *properties, Unit *owner) :
TempSummon::TempSummon(SummonPropertiesEntry const* properties, Unit* owner) :
Creature(), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
m_timer(0), m_lifetime(0)
{
@@ -174,7 +174,7 @@ void TempSummon::InitStats(uint32 duration)
if (m_type == TEMPSUMMON_MANUAL_DESPAWN)
m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
Unit *owner = GetSummoner();
Unit* owner = GetSummoner();
if (owner && isTrigger() && m_spells[0])
{
@@ -193,7 +193,7 @@ void TempSummon::InitStats(uint32 duration)
{
if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
{
Creature *oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
if (oldSummon && oldSummon->isSummon())
oldSummon->ToTempSummon()->UnSummon();
}
@@ -228,7 +228,7 @@ void TempSummon::UnSummon(uint32 msTime)
{
if (msTime)
{
ForcedUnsummonDelayEvent *pEvent = new ForcedUnsummonDelayEvent(*this);
ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);
m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
return;
@@ -272,7 +272,7 @@ void TempSummon::RemoveFromWorld()
Creature::RemoveFromWorld();
}
Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
Minion::Minion(SummonPropertiesEntry const* properties, Unit* owner) : TempSummon(properties, owner)
, m_owner(owner)
{
ASSERT(m_owner);
@@ -306,7 +306,7 @@ bool Minion::IsGuardianPet() const
return isPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
}
Guardian::Guardian(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner)
, m_bonusSpellDamage(0)
{
memset(m_statFromOwner, 0, sizeof(float)*MAX_STATS);
@@ -340,7 +340,7 @@ void Guardian::InitSummon()
m_owner->ToPlayer()->CharmSpellInitialize();
}
Puppet::Puppet(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
Puppet::Puppet(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner)
{
ASSERT(owner->GetTypeId() == TYPEID_PLAYER);
m_owner = (Player*)owner;
@@ -24,7 +24,7 @@
class TempSummon : public Creature
{
public:
explicit TempSummon(SummonPropertiesEntry const *properties, Unit *owner);
explicit TempSummon(SummonPropertiesEntry const* properties, Unit* owner);
virtual ~TempSummon() {}
void Update(uint32 time);
virtual void InitStats(uint32 lifetime);
@@ -37,7 +37,7 @@ class TempSummon : public Creature
uint64 GetSummonerGUID() { return m_summonerGUID; }
TempSummonType const& GetSummonType() { return m_type; }
const SummonPropertiesEntry * const m_Properties;
const SummonPropertiesEntry* const m_Properties;
private:
TempSummonType m_type;
uint32 m_timer;
@@ -48,10 +48,10 @@ class TempSummon : public Creature
class Minion : public TempSummon
{
public:
Minion(SummonPropertiesEntry const *properties, Unit *owner);
Minion(SummonPropertiesEntry const* properties, Unit* owner);
void InitStats(uint32 duration);
void RemoveFromWorld();
Unit *GetOwner() { return m_owner; }
Unit* GetOwner() { return m_owner; }
float GetFollowAngle() const { return m_followAngle; }
void SetFollowAngle(float angle) { m_followAngle = angle; }
bool IsPetGhoul() const {return GetEntry() == 26125;} // Ghoul may be guardian or pet
@@ -64,7 +64,7 @@ class Minion : public TempSummon
class Guardian : public Minion
{
public:
Guardian(SummonPropertiesEntry const *properties, Unit *owner);
Guardian(SummonPropertiesEntry const* properties, Unit* owner);
void InitStats(uint32 duration);
bool InitStatsForLevel(uint8 level);
void InitSummon();
@@ -88,13 +88,13 @@ class Guardian : public Minion
class Puppet : public Minion
{
public:
Puppet(SummonPropertiesEntry const *properties, Unit *owner);
Puppet(SummonPropertiesEntry const* properties, Unit* owner);
void InitStats(uint32 duration);
void InitSummon();
void Update(uint32 time);
void RemoveFromWorld();
protected:
Player *m_owner;
Player* m_owner;
};
class ForcedUnsummonDelayEvent : public BasicEvent
@@ -154,7 +154,7 @@ void GameObject::RemoveFromWorld()
}
}
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit)
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit)
{
ASSERT(map);
SetMap(map);
@@ -465,7 +465,7 @@ void GameObject::Update(uint32 diff)
{
//Battleground gameobjects case
if (ok->ToPlayer()->InBattleground())
if (Battleground *bg = ok->ToPlayer()->GetBattleground())
if (Battleground* bg = ok->ToPlayer()->GetBattleground())
bg->HandleTriggerBuff(GetGUID());
}
}
@@ -629,7 +629,7 @@ void GameObject::Delete()
AddObjectToRemoveList();
}
void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner)
void GameObject::getFishLoot(Loot* fishloot, Player* loot_owner)
{
fishloot->clear();
@@ -646,7 +646,7 @@ void GameObject::SaveToDB()
{
// this should only be used when the gameobject has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
GameObjectData const *data = sObjectMgr->GetGOData(m_DBTableGuid);
GameObjectData const* data = sObjectMgr->GetGOData(m_DBTableGuid);
if (!data)
{
sLog->outError("GameObject::SaveToDB failed, cannot get gameobject data!");
@@ -658,7 +658,7 @@ void GameObject::SaveToDB()
void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
{
const GameObjectTemplate *goI = GetGOInfo();
const GameObjectTemplate* goI = GetGOInfo();
if (!goI)
return;
@@ -712,7 +712,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabase.CommitTransaction(trans);
}
bool GameObject::LoadFromDB(uint32 guid, Map *map)
bool GameObject::LoadFromDB(uint32 guid, Map* map)
{
GameObjectData const* data = sObjectMgr->GetGOData(guid);
@@ -878,7 +878,7 @@ void GameObject::Respawn()
}
}
bool GameObject::ActivateToQuest(Player *pTarget) const
bool GameObject::ActivateToQuest(Player* pTarget) const
{
if (pTarget->HasQuestForGO(GetEntry()))
return true;
@@ -896,7 +896,7 @@ bool GameObject::ActivateToQuest(Player *pTarget) const
//TODO: fix this hack
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team
if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
if (Battleground *bg = pTarget->GetBattleground())
if (Battleground* bg = pTarget->GetBattleground())
if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam())))
return false;
return true;
@@ -997,14 +997,14 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
void GameObject::SetGoArtKit(uint8 kit)
{
SetByteValue(GAMEOBJECT_BYTES_1, 2, kit);
GameObjectData *data = const_cast<GameObjectData*>(sObjectMgr->GetGOData(m_DBTableGuid));
GameObjectData* data = const_cast<GameObjectData*>(sObjectMgr->GetGOData(m_DBTableGuid));
if (data)
data->artKit = kit;
}
void GameObject::SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid)
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid)
{
const GameObjectData *data = NULL;
const GameObjectData* data = NULL;
if (go)
{
go->SetGoArtKit(artkit);
@@ -1477,7 +1477,7 @@ void GameObject::Use(Unit* user)
if (player->CanUseBattlegroundObject())
{
// in battleground check
Battleground *bg = player->GetBattleground();
Battleground* bg = player->GetBattleground();
if (!bg)
return;
if (player->GetVehicle())
@@ -1685,7 +1685,7 @@ const char* GameObject::GetNameForLocaleIdx(LocaleConstant loc_idx) const
if (loc_idx != DEFAULT_LOCALE)
{
uint8 uloc_idx = uint8(loc_idx);
if (GameObjectLocale const *cl = sObjectMgr->GetGameObjectLocale(GetEntry()))
if (GameObjectLocale const* cl = sObjectMgr->GetGameObjectLocale(GetEntry()))
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
return cl->Name[uloc_idx].c_str();
}
@@ -623,7 +623,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void RemoveFromWorld();
void CleanupsBeforeDelete(bool finalCleanup = true);
bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
void Update(uint32 p_time);
static GameObject* GetGameObject(WorldObject& object, uint64 guid);
GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
@@ -648,7 +648,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void SaveToDB();
void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
bool LoadFromDB(uint32 guid, Map *map);
bool LoadFromDB(uint32 guid, Map* map);
void DeleteFromDB();
void SetOwnerGUID(uint64 owner)
@@ -698,7 +698,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
uint32 GetRespawnDelay() const { return m_respawnDelayTime; }
void Refresh();
void Delete();
void getFishLoot(Loot *loot, Player* loot_owner);
void getFishLoot(Loot* loot, Player* loot_owner);
GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); }
void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); }
GOState GetGoState() const { return GOState(GetByteValue(GAMEOBJECT_BYTES_1, 0)); }
@@ -707,7 +707,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void SetGoArtKit(uint8 artkit);
uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); }
void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); }
static void SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid = 0);
static void SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid = 0);
void Use(Unit* user);
@@ -745,7 +745,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
bool hasQuest(uint32 quest_id) const;
bool hasInvolvedQuest(uint32 quest_id) const;
bool ActivateToQuest(Player *pTarget) const;
bool ActivateToQuest(Player* pTarget) const;
void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false);
// 0 = use `gameobject`.`spawntimesecs`
void ResetDoorOrButton();
@@ -31,13 +31,13 @@ Bag::Bag(): Item()
m_valuesCount = CONTAINER_END;
memset(m_bagslot, 0, sizeof(Item *) * MAX_BAG_SIZE);
memset(m_bagslot, 0, sizeof(Item* ) * MAX_BAG_SIZE);
}
Bag::~Bag()
{
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
if (Item *item = m_bagslot[i])
if (Item* item = m_bagslot[i])
{
if (item->IsInWorld())
{
@@ -153,7 +153,7 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/)
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0);
}
void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/)
{
ASSERT(slot < MAX_BAG_SIZE);
@@ -168,7 +168,7 @@ void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
}
}
void Bag::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
void Bag::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
Item::BuildCreateUpdateBlockForPlayer(data, target);
@@ -189,7 +189,7 @@ bool Bag::IsEmpty() const
uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
{
Item *pItem;
Item* pItem;
uint32 count = 0;
for (uint32 i=0; i < GetBagSize(); ++i)
{
@@ -215,9 +215,9 @@ uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem)
{
uint32 count = 0;
for (uint32 i = 0; i < GetBagSize(); ++i)
if (Item *pItem = m_bagslot[i])
if (Item* pItem = m_bagslot[i])
if (pItem != skipItem)
if (ItemTemplate const *pProto = pItem->GetTemplate())
if (ItemTemplate const* pProto = pItem->GetTemplate())
if (pProto->ItemLimitCategory == limitCategory)
count += m_bagslot[i]->GetCount();
@@ -38,7 +38,7 @@ class Bag : public Item
bool Create(uint32 guidlow, uint32 itemid, Player const* owner);
void Clear();
void StoreItem(uint8 slot, Item *pItem, bool update);
void StoreItem(uint8 slot, Item* pItem, bool update);
void RemoveItem(uint8 slot, bool update);
Item* GetItemByPos(uint8 slot) const;
@@ -58,7 +58,7 @@ class Bag : public Item
// overwrite virtual Item::DeleteFromDB
void DeleteFromDB(SQLTransaction& trans);
void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const;
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
protected:
+18 -18
View File
@@ -110,11 +110,11 @@ void AddItemsSetItem(Player* player, Item* item)
}
}
void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
{
uint32 setid = proto->ItemSet;
ItemSetEntry const *set = sItemSetStore.LookupEntry(setid);
ItemSetEntry const* set = sItemSetStore.LookupEntry(setid);
if (!set)
{
@@ -122,7 +122,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
return;
}
ItemSetEffect *eff = NULL;
ItemSetEffect* eff = NULL;
size_t setindex = 0;
for (; setindex < player->ItemSetEff.size(); setindex++)
{
@@ -168,7 +168,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
}
}
bool ItemCanGoIntoBag(ItemTemplate const *pProto, ItemTemplate const *pBagProto)
bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto)
{
if (!pProto || !pBagProto)
return false;
@@ -264,7 +264,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0);
SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0);
ItemTemplate const *itemProto = sObjectMgr->GetItemTemplate(itemid);
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemid);
if (!itemProto)
return false;
@@ -497,7 +497,7 @@ void Item::DeleteFromInventoryDB(SQLTransaction& trans)
DeleteFromInventoryDB(trans, GetGUIDLow());
}
ItemTemplate const *Item::GetTemplate() const
ItemTemplate const* Item::GetTemplate() const
{
return sObjectMgr->GetItemTemplate(GetEntry());
}
@@ -586,7 +586,7 @@ uint32 Item::GetSpell()
int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
{
ItemTemplate const *itemProto = sObjectMgr->GetItemTemplate(item_id);
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
if (!itemProto)
return 0;
@@ -606,7 +606,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
if (itemProto->RandomProperty)
{
uint32 randomPropId = GetItemEnchantMod(itemProto->RandomProperty);
ItemRandomPropertiesEntry const *random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
ItemRandomPropertiesEntry const* random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
@@ -619,7 +619,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
else
{
uint32 randomPropId = GetItemEnchantMod(itemProto->RandomSuffix);
ItemRandomSuffixEntry const *random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
ItemRandomSuffixEntry const* random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
@@ -637,7 +637,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
if (randomPropId > 0)
{
ItemRandomPropertiesEntry const *item_rand = sItemRandomPropertiesStore.LookupEntry(randomPropId);
ItemRandomPropertiesEntry const* item_rand = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (item_rand)
{
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != int32(item_rand->ID))
@@ -651,7 +651,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
}
else
{
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId);
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId);
if (item_rand)
{
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != -int32(item_rand->ID) ||
@@ -676,7 +676,7 @@ void Item::UpdateItemSuffixFactor()
SetUInt32Value(ITEM_FIELD_PROPERTY_SEED, suffixFactor);
}
void Item::SetState(ItemUpdateState state, Player *forplayer)
void Item::SetState(ItemUpdateState state, Player* forplayer)
{
if (uState == ITEM_NEW && state == ITEM_REMOVED)
{
@@ -778,7 +778,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const
return true;
}
bool Item::HasEnchantRequiredSkill(const Player *pPlayer) const
bool Item::HasEnchantRequiredSkill(const Player* pPlayer) const
{
// Check all enchants for required skill
@@ -1036,7 +1036,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
if (count < 1)
return NULL; //don't create item at zero count
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(item);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (pProto)
{
if (count > pProto->GetMaxStackSize())
@@ -1044,7 +1044,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
Item *pItem = NewItemOrBag(pProto);
Item* pItem = NewItemOrBag(pProto);
if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player))
{
pItem->SetCount(count);
@@ -1116,7 +1116,7 @@ bool ItemRequiredTarget::IsFitToRequirements(Unit* pUnitTarget) const
void Item::BuildUpdate(UpdateDataMapType& data_map)
{
if (Player *owner = GetOwner())
if (Player* owner = GetOwner())
BuildFieldsUpdate(owner, data_map);
ClearUpdateMask(false);
}
@@ -1136,7 +1136,7 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
(*trans)->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow());
}
void Item::SetNotRefundable(Player *owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
{
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
return;
@@ -1154,7 +1154,7 @@ void Item::SetNotRefundable(Player *owner, bool changestate /*=true*/, SQLTransa
owner->DeleteRefundReference(GetGUIDLow());
}
void Item::UpdatePlayedTime(Player *owner)
void Item::UpdatePlayedTime(Player* owner)
{
/* Here we update our played time
We simply add a number to the current played time,
+9 -9
View File
@@ -33,7 +33,7 @@ struct ItemSetEffect
{
uint32 setid;
uint32 item_count;
SpellInfo const *spells[8];
SpellInfo const* spells[8];
};
enum InventoryResult
@@ -221,7 +221,7 @@ struct ItemRequiredTarget
bool IsFitToRequirements(Unit* pUnitTarget) const;
};
bool ItemCanGoIntoBag(ItemTemplate const *proto, ItemTemplate const *pBagProto);
bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
class Item : public Object
{
@@ -264,7 +264,7 @@ class Item : public Object
void SetInTrade(bool b = true) { mb_in_trade = b; }
bool IsInTrade() const { return mb_in_trade; }
bool HasEnchantRequiredSkill(const Player *pPlayer) const;
bool HasEnchantRequiredSkill(const Player* pPlayer) const;
uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
@@ -280,11 +280,11 @@ class Item : public Object
InventoryResult CanBeMergedPartlyWith(ItemTemplate const* proto) const;
uint8 GetSlot() const {return m_slot;}
Bag *GetContainer() { return m_container; }
Bag* GetContainer() { return m_container; }
uint8 GetBagSlot() const;
void SetSlot(uint8 slot) { m_slot = slot; }
uint16 GetPos() const { return uint16(GetBagSlot()) << 8 | GetSlot(); }
void SetContainer(Bag *container) { m_container = container; }
void SetContainer(Bag* container) { m_container = container; }
bool IsInBag() const { return m_container != NULL; }
bool IsEquipped() const;
@@ -321,7 +321,7 @@ class Item : public Object
// Update States
ItemUpdateState GetState() const { return uState; }
void SetState(ItemUpdateState state, Player *forplayer = NULL);
void SetState(ItemUpdateState state, Player* forplayer = NULL);
void AddToUpdateQueueOf(Player* player);
void RemoveFromUpdateQueueOf(Player* player);
bool IsInUpdateQueue() const { return uQueuePos != -1; }
@@ -339,7 +339,7 @@ class Item : public Object
bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); }
// Item Refund system
void SetNotRefundable(Player *owner, bool changestate = true, SQLTransaction* trans = NULL);
void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = NULL);
void SetRefundRecipient(uint32 pGuidLow) { m_refundRecipient = pGuidLow; }
void SetPaidMoney(uint32 money) { m_paidMoney = money; }
void SetPaidExtendedCost(uint32 iece) { m_paidExtendedCost = iece; }
@@ -347,7 +347,7 @@ class Item : public Object
uint32 GetPaidMoney() { return m_paidMoney; }
uint32 GetPaidExtendedCost() { return m_paidExtendedCost; }
void UpdatePlayedTime(Player *owner);
void UpdatePlayedTime(Player* owner);
uint32 GetPlayedTime();
bool IsRefundExpired();
@@ -361,7 +361,7 @@ class Item : public Object
private:
std::string m_text;
uint8 m_slot;
Bag *m_container;
Bag* m_container;
ItemUpdateState uState;
int16 uQueuePos;
bool mb_in_trade; // true if item is currently in trade-window
@@ -57,7 +57,7 @@ void LoadRandomEnchantmentsTable()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
uint32 ench = fields[1].GetUInt32();
@@ -120,14 +120,14 @@ uint32 GetItemEnchantMod(int32 entry)
uint32 GenerateEnchSuffixFactor(uint32 item_id)
{
ItemTemplate const *itemProto = sObjectMgr->GetItemTemplate(item_id);
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
if (!itemProto)
return 0;
if (!itemProto->RandomSuffix)
return 0;
RandomPropertiesPointsEntry const *randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel);
RandomPropertiesPointsEntry const* randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel);
if (!randomProperty)
return 0;
+33 -33
View File
@@ -183,7 +183,7 @@ void Object::RemoveFromWorld()
ClearUpdateMask(true);
}
void Object::BuildMovementUpdateBlock(UpdateData * data, uint32 flags) const
void Object::BuildMovementUpdateBlock(UpdateData* data, uint32 flags) const
{
ByteBuffer buf(500);
@@ -195,7 +195,7 @@ void Object::BuildMovementUpdateBlock(UpdateData * data, uint32 flags) const
data->AddUpdateBlock(buf);
}
void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
if (!target)
return;
@@ -270,7 +270,7 @@ void Object::SendUpdateToPlayer(Player* player)
player->GetSession()->SendPacket(&packet);
}
void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const
void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
ByteBuffer buf(500);
@@ -286,12 +286,12 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) c
data->AddUpdateBlock(buf);
}
void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const
{
data->AddOutOfRangeGUID(GetGUID());
}
void Object::DestroyForPlayer(Player *target, bool anim) const
void Object::DestroyForPlayer(Player* target, bool anim) const
{
ASSERT(target);
@@ -414,14 +414,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
*data << (float)0;
*data << (float)0;
*data << (float)0;
*data << ((WorldObject *)this)->GetOrientation();
*data << ((WorldObject* )this)->GetOrientation();
}
else
{
*data << ((WorldObject *)this)->GetPositionX();
*data << ((WorldObject *)this)->GetPositionY();
*data << ((WorldObject *)this)->GetPositionZ();
*data << ((WorldObject *)this)->GetOrientation();
*data << ((WorldObject* )this)->GetPositionX();
*data << ((WorldObject* )this)->GetPositionY();
*data << ((WorldObject* )this)->GetPositionZ();
*data << ((WorldObject* )this)->GetOrientation();
}
}
}
@@ -491,7 +491,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
}
}
void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *updateMask, Player *target) const
void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* updateMask, Player* target) const
{
if (!target)
return;
@@ -1251,7 +1251,7 @@ void WorldObject::setActive(bool on)
if (!IsInWorld())
return;
Map *map = FindMap();
Map* map = FindMap();
if (!map)
return;
@@ -1298,7 +1298,7 @@ void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const
InstanceScript* WorldObject::GetInstanceScript()
{
Map *map = GetMap();
Map* map = GetMap();
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceScript() : NULL;
}
@@ -1354,7 +1354,7 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const
{
float x, y, z;
GetPosition(x, y, z);
VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
return vMapManager->isInLineOfSight(GetMapId(), x, y, z+2.0f, ox, oy, oz+2.0f);
}
@@ -1466,7 +1466,7 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset
retOffset.m_orientation = endPos.GetOrientation() - GetOrientation();
}
float Position::GetAngle(const Position *obj) const
float Position::GetAngle(const Position* obj) const
{
if (!obj) return 0;
return GetAngle(obj->GetPositionX(), obj->GetPositionY());
@@ -1502,7 +1502,7 @@ void Position::GetSinCos(const float x, const float y, float &vsin, float &vcos)
}
}
bool Position::HasInArc(float arc, const Position *obj) const
bool Position::HasInArc(float arc, const Position* obj) const
{
// always have self in arc
if (obj == this)
@@ -1524,7 +1524,7 @@ bool Position::HasInArc(float arc, const Position *obj) const
return ((angle >= lborder) && (angle <= rborder));
}
bool WorldObject::IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size) const
bool WorldObject::IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size) const
{
if (GetPositionX() > std::max(obj1->GetPositionX(), obj2->GetPositionX())
|| GetPositionX() < std::min(obj1->GetPositionX(), obj2->GetPositionX())
@@ -2002,7 +2002,7 @@ void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisp
player->GetSession()->SendPacket(&data);
}
void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 targetGuid) const
void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 targetGuid) const
{
*data << (uint8)msgtype;
*data << (uint32)language;
@@ -2021,26 +2021,26 @@ void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const*
*data << (uint8)0; // ChatTag
}
void Unit::BuildHeartBeatMsg(WorldPacket *data) const
void Unit::BuildHeartBeatMsg(WorldPacket* data) const
{
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
data->append(GetPackGUID());
BuildMovementPacket(data);
}
void WorldObject::SendMessageToSet(WorldPacket *data, bool self)
void WorldObject::SendMessageToSet(WorldPacket* data, bool self)
{
SendMessageToSetInRange(data, GetVisibilityRange(), self);
}
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*self*/)
void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/)
{
Trinity::MessageDistDeliverer notifier(this, data, dist);
VisitNearbyWorldObject(dist, notifier);
}
void WorldObject::SendMessageToSet(WorldPacket *data, Player const* skipped_rcvr)
void WorldObject::SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr)
{
Trinity::MessageDistDeliverer notifier(this, data, GetVisibilityRange(), false, skipped_rcvr);
VisitNearbyWorldObject(GetVisibilityRange(), notifier);
@@ -2053,7 +2053,7 @@ void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
SendMessageToSet(&data, true);
}
void WorldObject::SetMap(Map * map)
void WorldObject::SetMap(Map* map)
{
ASSERT(map);
ASSERT(!IsInWorld() || GetTypeId() == TYPEID_CORPSE);
@@ -2204,7 +2204,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
void WorldObject::SetZoneScript()
{
if (Map *map = FindMap())
if (Map* map = FindMap())
{
if (map->IsDungeon())
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
@@ -2215,9 +2215,9 @@ void WorldObject::SetZoneScript()
TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/) const
{
if (Map *map = FindMap())
if (Map* map = FindMap())
{
if (TempSummon *summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL))
if (TempSummon* summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL))
{
summon->SetTempSummonType(spwtype);
return summon;
@@ -2267,7 +2267,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
return NULL;
}
Map *map = GetMap();
Map* map = GetMap();
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
@@ -2351,8 +2351,8 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
sLog->outErrorDb("Gameobject template %u not found in database!", entry);
return NULL;
}
Map *map = GetMap();
GameObject *go = new GameObject();
Map* map = GetMap();
GameObject* go = new GameObject();
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
delete go;
@@ -2389,7 +2389,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
{
Creature *creature = NULL;
Creature* creature = NULL;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
VisitNearbyObject(range, searcher);
@@ -2398,7 +2398,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
{
GameObject *go = NULL;
GameObject* go = NULL;
Trinity::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
@@ -2743,7 +2743,7 @@ void WorldObject::DestroyForNearbyPlayers()
VisitNearbyWorldObject(GetVisibilityRange(), searcher);
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
Player *plr = (*iter);
Player* plr = (*iter);
if (plr == this)
continue;
@@ -2816,7 +2816,7 @@ struct WorldObjectChangeAccumulator
if (IS_PLAYER_GUID(guid))
{
//Caster may be NULL if DynObj is in removelist
if (Player *caster = ObjectAccessor::FindPlayer(guid))
if (Player* caster = ObjectAccessor::FindPlayer(guid))
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == source->GetGUID())
BuildPacket(caster);
}
+40 -40
View File
@@ -140,14 +140,14 @@ class Object
TypeID GetTypeId() const { return m_objectTypeId; }
bool isType(uint16 mask) const { return (mask & m_objectType); }
virtual void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const;
virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void SendUpdateToPlayer(Player* player);
void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const;
void BuildOutOfRangeUpdateBlock(UpdateData *data) const;
void BuildMovementUpdateBlock(UpdateData * data, uint32 flags = 0) const;
void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void BuildOutOfRangeUpdateBlock(UpdateData* data) const;
void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const;
virtual void DestroyForPlayer(Player *target, bool anim = false) const;
virtual void DestroyForPlayer(Player* target, bool anim = false) const;
int32 GetInt32Value(uint16 index) const
{
@@ -294,7 +294,7 @@ class Object
virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
virtual void BuildUpdate(UpdateDataMapType&) {}
void BuildFieldsUpdate(Player *, UpdateDataMapType &) const;
void BuildFieldsUpdate(Player* , UpdateDataMapType &) const;
// FG: some hacky helpers
void ForceValuesUpdateAtIndex(uint32);
@@ -320,11 +320,11 @@ class Object
std::string _ConcatFields(uint16 startIndex, uint16 size) const;
void _LoadIntoDataField(const char* data, uint32 startOffset, uint32 count);
virtual void _SetUpdateBits(UpdateMask *updateMask, Player *target) const;
virtual void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
virtual void _SetCreateBits(UpdateMask *updateMask, Player *target) const;
virtual void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
void _BuildMovementUpdate(ByteBuffer * data, uint16 flags) const;
void _BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask *updateMask, Player *target) const;
void _BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask* updateMask, Player* target) const;
uint16 m_objectType;
@@ -382,7 +382,7 @@ struct Position
{ m_positionX = x; m_positionY = y; m_positionZ = z; m_orientation = orientation; }
void Relocate(const Position &pos)
{ m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; m_orientation = pos.m_orientation; }
void Relocate(const Position *pos)
void Relocate(const Position* pos)
{ m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; m_orientation = pos->m_orientation; }
void RelocateOffset(const Position &offset);
void SetOrientation(float orientation)
@@ -399,7 +399,7 @@ struct Position
{ x = m_positionX; y = m_positionY; z = m_positionZ; }
void GetPosition(float &x, float &y, float &z, float &o) const
{ x = m_positionX; y = m_positionY; z = m_positionZ; o = m_orientation; }
void GetPosition(Position *pos) const
void GetPosition(Position* pos) const
{
if (pos)
pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation);
@@ -420,37 +420,37 @@ struct Position
{ float dx = m_positionX - x; float dy = m_positionY - y; return dx*dx + dy*dy; }
float GetExactDist2d(const float x, const float y) const
{ return sqrt(GetExactDist2dSq(x, y)); }
float GetExactDist2dSq(const Position *pos) const
float GetExactDist2dSq(const Position* pos) const
{ float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; return dx*dx + dy*dy; }
float GetExactDist2d(const Position *pos) const
float GetExactDist2d(const Position* pos) const
{ return sqrt(GetExactDist2dSq(pos)); }
float GetExactDistSq(float x, float y, float z) const
{ float dz = m_positionZ - z; return GetExactDist2dSq(x, y) + dz*dz; }
float GetExactDist(float x, float y, float z) const
{ return sqrt(GetExactDistSq(x, y, z)); }
float GetExactDistSq(const Position *pos) const
float GetExactDistSq(const Position* pos) const
{ float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; float dz = m_positionZ - pos->m_positionZ; return dx*dx + dy*dy + dz*dz; }
float GetExactDist(const Position *pos) const
float GetExactDist(const Position* pos) const
{ return sqrt(GetExactDistSq(pos)); }
void GetPositionOffsetTo(const Position & endPos, Position & retOffset) const;
float GetAngle(const Position *pos) const;
float GetAngle(const Position* pos) const;
float GetAngle(float x, float y) const;
float GetRelativeAngle(const Position *pos) const
float GetRelativeAngle(const Position* pos) const
{ return GetAngle(pos) - m_orientation; }
float GetRelativeAngle(float x, float y) const { return GetAngle(x, y) - m_orientation; }
void GetSinCos(float x, float y, float &vsin, float &vcos) const;
bool IsInDist2d(float x, float y, float dist) const
{ return GetExactDist2dSq(x, y) < dist * dist; }
bool IsInDist2d(const Position *pos, float dist) const
bool IsInDist2d(const Position* pos, float dist) const
{ return GetExactDist2dSq(pos) < dist * dist; }
bool IsInDist(float x, float y, float z, float dist) const
{ return GetExactDistSq(x, y, z) < dist * dist; }
bool IsInDist(const Position *pos, float dist) const
bool IsInDist(const Position* pos, float dist) const
{ return GetExactDistSq(pos) < dist * dist; }
bool HasInArc(float arcangle, const Position *pos) const;
bool HasInArc(float arcangle, const Position* pos) const;
bool HasInLine(Unit const* target, float distance, float width) const;
std::string ToString() const;
};
@@ -640,7 +640,7 @@ class WorldObject : public Object, public WorldLocation
virtual const char* GetNameForLocaleIdx(LocaleConstant /*locale_idx*/) const { return GetName(); }
float GetDistance(const WorldObject *obj) const
float GetDistance(const WorldObject* obj) const
{
float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize();
return d > 0.0f ? d : 0.0f;
@@ -676,11 +676,11 @@ class WorldObject : public Object, public WorldLocation
}
bool IsWithinDist3d(float x, float y, float z, float dist) const
{ return IsInDist(x, y, z, dist + GetObjectSize()); }
bool IsWithinDist3d(const Position *pos, float dist) const
bool IsWithinDist3d(const Position* pos, float dist) const
{ return IsInDist(pos, dist + GetObjectSize()); }
bool IsWithinDist2d(float x, float y, float dist) const
{ return IsInDist2d(x, y, dist + GetObjectSize()); }
bool IsWithinDist2d(const Position *pos, float dist) const
bool IsWithinDist2d(const Position* pos, float dist) const
{ return IsInDist2d(pos, dist + GetObjectSize()); }
virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const;
// use only if you will sure about placing both object at same map
@@ -701,13 +701,13 @@ class WorldObject : public Object, public WorldLocation
bool isInFront(WorldObject const* target, float distance, float arc = M_PI) const;
bool isInBack(WorldObject const* target, float distance, float arc = M_PI) const;
bool IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size = 0) const;
bool IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size = 0) const;
virtual void CleanupsBeforeDelete(bool finalCleanup = true); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
virtual void SendMessageToSet(WorldPacket *data, bool self);
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self);
virtual void SendMessageToSet(WorldPacket *data, Player const* skipped_rcvr);
virtual void SendMessageToSet(WorldPacket* data, bool self);
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self);
virtual void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr);
virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; }
@@ -720,7 +720,7 @@ class WorldObject : public Object, public WorldLocation
void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false);
void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid);
void BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
void BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
void PlayDirectSound(uint32 sound_id, Player* target = NULL);
@@ -760,17 +760,17 @@ class WorldObject : public Object, public WorldLocation
// Low Level Packets
void SendPlaySound(uint32 Sound, bool OnlySelf);
virtual void SetMap(Map * map);
virtual void SetMap(Map* map);
virtual void ResetMap();
Map * GetMap() const { ASSERT(m_currMap); return m_currMap; }
Map * FindMap() const { return m_currMap; }
Map* GetMap() const { ASSERT(m_currMap); return m_currMap; }
Map* FindMap() const { return m_currMap; }
//used to check all object's GetMap() calls when object is not in world!
//this function should be removed in nearest time...
Map const* GetBaseMap() const;
void SetZoneScript();
ZoneScript * GetZoneScript() const { return m_zoneScript; }
ZoneScript* GetZoneScript() const { return m_zoneScript; }
TempSummon* SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const;
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0)
@@ -823,7 +823,7 @@ class WorldObject : public Object, public WorldLocation
uint32 LastUsedScriptID;
// Transports
Transport *GetTransport() const { return m_transport; }
Transport* GetTransport() const { return m_transport; }
virtual float GetTransOffsetX() const { return 0; }
virtual float GetTransOffsetY() const { return 0; }
virtual float GetTransOffsetZ() const { return 0; }
@@ -831,16 +831,16 @@ class WorldObject : public Object, public WorldLocation
virtual uint32 GetTransTime() const { return 0; }
virtual int8 GetTransSeat() const { return -1; }
virtual uint64 GetTransGUID() const;
void SetTransport(Transport *t) { m_transport = t; }
void SetTransport(Transport* t) { m_transport = t; }
MovementInfo m_movementInfo;
protected:
std::string m_name;
bool m_isActive;
ZoneScript *m_zoneScript;
ZoneScript* m_zoneScript;
// transports
Transport *m_transport;
Transport* m_transport;
//these functions are used mostly for Relocate() and Corpse/Player specific stuff...
//use them ONLY in LoadFromDB()/Create() funcs and nowhere else!
@@ -849,7 +849,7 @@ class WorldObject : public Object, public WorldLocation
void SetLocationInstanceId(uint32 _instanceId) { m_InstanceId = _instanceId; }
private:
Map * m_currMap; //current object's Map location
Map* m_currMap; //current object's Map location
//uint32 m_mapId; // object at map with map_id
uint32 m_InstanceId; // in map copy with instance id
@@ -879,13 +879,13 @@ namespace Trinity
class ObjectDistanceOrderPred
{
public:
ObjectDistanceOrderPred(const WorldObject *pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {}
bool operator()(const WorldObject *pLeft, const WorldObject *pRight) const
ObjectDistanceOrderPred(const WorldObject* pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {}
bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const
{
return m_ascending ? m_refObj->GetDistanceOrder(pLeft, pRight) : !m_refObj->GetDistanceOrder(pLeft, pRight);
}
private:
const WorldObject *m_refObj;
const WorldObject* m_refObj;
const bool m_ascending;
};
}
+25 -25
View File
@@ -33,7 +33,7 @@
#define PET_XP_FACTOR 0.05f
Pet::Pet(Player *owner, PetType type) : Guardian(NULL, owner),
Pet::Pet(Player* owner, PetType type) : Guardian(NULL, owner),
m_usedTalentCount(0), m_removed(false), m_owner(owner),
m_happinessTimer(7500), m_petType(type), m_duration(0),
m_auraRaidUpdateMask(0), m_loading(false), m_declinedname(NULL)
@@ -130,7 +130,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
return false;
}
Field *fields = result->Fetch();
Field* fields = result->Fetch();
// update for case of current pet "slot = 0"
petentry = fields[1].GetUInt32();
@@ -162,7 +162,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
return false;
}
Map *map = owner->GetMap();
Map* map = owner->GetMap();
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
if (!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number))
return false;
@@ -182,7 +182,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
if (cinfo->type == CREATURE_TYPE_CRITTER)
{
map->Add(this->ToCreature());
@@ -318,7 +318,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
{
delete m_declinedname;
m_declinedname = new DeclinedName;
Field *fields2 = result->Fetch();
Field* fields2 = result->Fetch();
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{
m_declinedname->name[i] = fields2[i].GetString();
@@ -706,7 +706,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
return false;
}
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
if (!cinfo)
{
sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
@@ -736,7 +736,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner)
return true;
}
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map * map, uint32 phaseMask)
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask)
{
sLog->outDebug(LOG_FILTER_PETS, "Pet::CreateBaseForTamed");
uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
@@ -765,7 +765,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map * map, uint32 pha
// TODO: Move stat mods code to pet passive auras
bool Guardian::InitStatsForLevel(uint8 petlevel)
{
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
ASSERT(cinfo);
SetLevel(petlevel);
@@ -1044,7 +1044,7 @@ void Pet::_LoadSpellCooldowns()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 spell_id = fields[0].GetUInt32();
time_t db_time = time_t(fields[1].GetUInt32());
@@ -1100,7 +1100,7 @@ void Pet::_LoadSpells()
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt8()), PETSPELL_UNCHANGED);
}
@@ -1150,7 +1150,7 @@ void Pet::_LoadAuras(uint32 timediff)
{
int32 damage[3];
int32 baseDamage[3];
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
uint32 spellid = fields[1].GetUInt32();
uint8 effmask = fields[2].GetUInt8();
@@ -1217,7 +1217,7 @@ void Pet::_SaveAuras(SQLTransaction& trans)
if (!itr->second->CanBeSaved() || IsPetAura(itr->second))
continue;
Aura * aura = itr->second;
Aura* aura = itr->second;
int32 damage[MAX_SPELL_EFFECTS];
int32 baseDamage[MAX_SPELL_EFFECTS];
@@ -1250,7 +1250,7 @@ void Pet::_SaveAuras(SQLTransaction& trans)
bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpellState state /*= PETSPELL_NEW*/, PetSpellType type /*= PETSPELL_NORMAL*/)
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
if (!spellInfo)
{
// do pet spell book cleanup
@@ -1306,7 +1306,7 @@ bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpe
// talent: unlearn all other talent ranks (high and low)
if (TalentSpellPos const* talentPos = GetTalentSpellPos(spell_id))
{
if (TalentEntry const *talentInfo = sTalentStore.LookupEntry(talentPos->talent_id))
if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentPos->talent_id))
{
for (uint8 i = 0; i < MAX_TALENT_RANK; ++i)
{
@@ -1395,7 +1395,7 @@ void Pet::InitLevelupSpellsForLevel()
{
uint8 level = getLevel();
if (PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
if (PetLevelupSpellSet const* levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
{
// PetLevelupSpellSet ordered by levels, process in reversed order
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
@@ -1412,7 +1412,7 @@ void Pet::InitLevelupSpellsForLevel()
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
if (PetDefaultSpellsEntry const *defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
{
for (uint8 i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
{
@@ -1525,7 +1525,7 @@ void Pet::InitPetCreateSpells()
bool Pet::resetTalents()
{
Unit *owner = GetOwner();
Unit* owner = GetOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return false;
@@ -1537,7 +1537,7 @@ bool Pet::resetTalents()
if (!ci)
return false;
// Check pet talent type
CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
if (!pet_family || pet_family->petTalentType < 0)
return false;
@@ -1554,12 +1554,12 @@ bool Pet::resetTalents()
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
{
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
if (!talentInfo)
continue;
TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
if (!talentTabInfo)
continue;
@@ -1635,7 +1635,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
do
{
Field *fields = resultPets->Fetch();
Field* fields = resultPets->Fetch();
uint32 id = fields[0].GetUInt32();
@@ -1653,7 +1653,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
bool need_execute = false;
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 spell = fields[0].GetUInt32();
@@ -1687,7 +1687,7 @@ void Pet::InitTalentForLevel()
SetFreeTalentPoints(talentPointsForLevel - m_usedTalentCount);
Unit *owner = GetOwner();
Unit* owner = GetOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return;
@@ -1699,7 +1699,7 @@ uint8 Pet::GetMaxTalentPointsForLevel(uint8 level)
{
uint8 points = (level >= 20) ? ((level - 16) / 4) : 0;
// Mod points from owner SPELL_AURA_MOD_PET_TALENT_POINTS
if (Unit *owner = GetOwner())
if (Unit* owner = GetOwner())
points+=owner->GetTotalAuraModifier(SPELL_AURA_MOD_PET_TALENT_POINTS);
return points;
}
@@ -1774,7 +1774,7 @@ bool Pet::IsPermanentPetFor(Player* owner)
}
}
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
bool Pet::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
{
ASSERT(map);
SetMap(map);

Some files were not shown because too many files have changed in this diff Show More