Core/Map:
- Remove mysterious restriction in visibilityhelper for gameobjects - Some cleanup in CheckAreaExploreAndOutdoor() and GridDefines.h - Set nocreate for cells visited in Map::VisitNearbyCellsOf
This commit is contained in:
@@ -6809,21 +6809,23 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA);
|
||||
|
||||
AreaTableEntry const* p = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId());
|
||||
if (!p)
|
||||
AreaTableEntry const* areaEntry = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId());
|
||||
if (!areaEntry)
|
||||
{
|
||||
sLog->outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetMapId());
|
||||
sLog->outError("Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId());
|
||||
return;
|
||||
}
|
||||
else if (p->area_level > 0)
|
||||
|
||||
if (areaEntry->area_level > 0)
|
||||
{
|
||||
uint32 area = p->ID;
|
||||
uint32 area = areaEntry->ID;
|
||||
if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendExplorationExperience(area, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 diff = int32(getLevel()) - p->area_level;
|
||||
int32 diff = int32(getLevel()) - areaEntry->area_level;
|
||||
uint32 XP = 0;
|
||||
if (diff < -5)
|
||||
{
|
||||
@@ -6837,17 +6839,17 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
else if (exploration_percent < 0)
|
||||
exploration_percent = 0;
|
||||
|
||||
XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE));
|
||||
XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE));
|
||||
}
|
||||
else
|
||||
{
|
||||
XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*sWorld->getRate(RATE_XP_EXPLORE));
|
||||
XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE));
|
||||
}
|
||||
|
||||
GiveXP(XP, NULL);
|
||||
SendExplorationExperience(area, XP);
|
||||
}
|
||||
sLog->outDetail("PLAYER: Player %u discovered a new area: %u", GetGUIDLow(), area);
|
||||
sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21464,13 +21466,6 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, T* target, std::set
|
||||
s64.insert(target->GetGUID());
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target, std::set<Unit*>& /*v*/)
|
||||
{
|
||||
if (!target->IsTransport())
|
||||
s64.insert(target->GetGUID());
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, Creature* target, std::set<Unit*>& v)
|
||||
{
|
||||
|
||||
@@ -493,6 +493,7 @@ void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<Trinity::Obj
|
||||
markCell(cell_id);
|
||||
CellCoord pair(x, y);
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
Visit(cell, gridVisitor);
|
||||
Visit(cell, worldVisitor);
|
||||
}
|
||||
@@ -509,9 +510,9 @@ void Map::Update(const uint32 t_diff)
|
||||
if (player && player->IsInWorld())
|
||||
{
|
||||
//player->Update(t_diff);
|
||||
WorldSession* pSession = player->GetSession();
|
||||
MapSessionFilter updater(pSession);
|
||||
pSession->Update(t_diff, updater);
|
||||
WorldSession* session = player->GetSession();
|
||||
MapSessionFilter updater(session);
|
||||
session->Update(t_diff, updater);
|
||||
}
|
||||
}
|
||||
/// update active cells around players and active objects
|
||||
|
||||
Reference in New Issue
Block a user