mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-05 03:53:48 +00:00
refactor(Core): code cleanup (part 2) (#6374)
This commit is contained in:
@@ -2986,7 +2986,7 @@ void InstanceMap::UnloadAll()
|
||||
{
|
||||
ASSERT(!HavePlayers());
|
||||
|
||||
if (m_resetAfterUnload == true)
|
||||
if (m_resetAfterUnload)
|
||||
{
|
||||
DeleteRespawnTimes();
|
||||
DeleteCorpseData();
|
||||
@@ -3331,9 +3331,9 @@ void Map::LogEncounterFinished(EncounterCreditType type, uint32 creditEntry)
|
||||
{
|
||||
std::string auraStr;
|
||||
const Unit::AuraApplicationMap& a = p->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = a.begin(); itr != a.end(); ++itr)
|
||||
for (auto iterator = a.begin(); iterator != a.end(); ++iterator)
|
||||
{
|
||||
snprintf(buffer2, 255, "%u(%u) ", itr->first, itr->second->GetEffectMask());
|
||||
snprintf(buffer2, 255, "%u(%u) ", iterator->first, iterator->second->GetEffectMask());
|
||||
auraStr += buffer2;
|
||||
}
|
||||
|
||||
@@ -3777,7 +3777,7 @@ bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float start
|
||||
}
|
||||
}
|
||||
|
||||
return failOnCollision ? !collided : true;
|
||||
return !failOnCollision || !collided;
|
||||
}
|
||||
|
||||
void Map::LoadCorpseData()
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "World.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "AvgDiffTracker.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "Config.h"
|
||||
#include "Corpse.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GridDefines.h"
|
||||
#include "Group.h"
|
||||
@@ -27,7 +24,6 @@
|
||||
#include "Transport.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
@@ -319,9 +315,13 @@ bool MapManager::IsValidMAP(uint32 mapid, bool startUp)
|
||||
MapEntry const* mEntry = sMapStore.LookupEntry(mapid);
|
||||
|
||||
if (startUp)
|
||||
return !!mEntry;
|
||||
{
|
||||
return mEntry != nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mEntry && (!mEntry->IsDungeon() || sObjectMgr->GetInstanceTemplate(mapid));
|
||||
}
|
||||
|
||||
// TODO: add check for battleground template
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user