Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-04-22 09:13:49 -06:00
committed by GitHub
30 changed files with 128 additions and 82 deletions

View File

@@ -359,7 +359,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
LOG_DEBUG("maps", "Switch object {} from grid[{}, {}] {}", obj->GetGUID().ToString(), cell.GridX(), cell.GridY(), on);
NGridType* ngrid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(ngrid != nullptr);
ASSERT(ngrid);
GridType& grid = ngrid->GetGridType(cell.CellX(), cell.CellY());
@@ -397,7 +397,7 @@ void Map::SwitchGridContainers(GameObject* obj, bool on)
//LOG_DEBUG(LOG_FILTER_MAPS, "Switch object {} from grid[{}, {}] {}", obj->GetGUID().ToString(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
NGridType* ngrid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(ngrid != nullptr);
ASSERT(ngrid);
GridType& grid = ngrid->GetGridType(cell.CellX(), cell.CellY());
@@ -471,7 +471,7 @@ bool Map::EnsureGridLoaded(const Cell& cell)
EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY()));
NGridType* grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(grid != nullptr);
ASSERT(grid);
if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
{
//if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))

View File

@@ -71,12 +71,12 @@ Map* MapMgr::CreateBaseMap(uint32 id)
{
Map* map = FindBaseMap(id);
if (map == nullptr)
if (!map)
{
std::lock_guard<std::mutex> guard(Lock);
map = FindBaseMap(id);
if (map == nullptr) // pussywizard: check again after acquiring mutex
if (!map) // pussywizard: check again after acquiring mutex
{
MapEntry const* entry = sMapStore.LookupEntry(id);
ASSERT(entry);

View File

@@ -66,7 +66,7 @@ void TransportMgr::LoadTransportTemplates()
Field* fields = result->Fetch();
uint32 entry = fields[0].Get<uint32>();
GameObjectTemplate const* goInfo = sObjectMgr->GetGameObjectTemplate(entry);
if (goInfo == nullptr)
if (!goInfo)
{
LOG_ERROR("entities.transport", "Transport {} has no associated GameObjectTemplate from `gameobject_template` , skipped.", entry);
continue;