aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-04 13:02:57 -0600
committermegamage <none@none>2009-04-04 13:02:57 -0600
commitc0a131a63d8d5f9b5c7d5c3373e588dbc7beb074 (patch)
tree8d83b40686892d3c257f77037ffd6c3290bce94e /src
parent98f3d4d8b3dc91953b56a9599ee0c48ca04cc889 (diff)
*Fix visibility update bug.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GridNotifiers.cpp3
-rw-r--r--src/game/Map.cpp11
-rw-r--r--src/game/Player.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp
index f52932df83d..e27abeccd0c 100644
--- a/src/game/GridNotifiers.cpp
+++ b/src/game/GridNotifiers.cpp
@@ -99,6 +99,9 @@ PlayerVisibilityNotifier::Notify()
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
i_player.SendInitialVisiblePackets((Unit*)(*vItr));
+
+ if(i_visibleNow.size() >= 30)
+ i_player.SetToNotify();
}
void
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 669baf275f8..21e6a26785d 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -615,7 +615,6 @@ void Map::RelocationNotify()
if(Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL))
{
i_unitsToNotify.push_back(unit);
- unit->m_Notified = false;
}
}
i_unitsToNotifyBacklog.clear();
@@ -624,11 +623,10 @@ void Map::RelocationNotify()
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
{
Unit *unit = *iter;
- unit->m_IsInNotifyList = false;
-
if(!unit->IsInWorld() || unit->GetMapId() != GetId())
continue;
+ unit->m_IsInNotifyList = false;
unit->m_Notified = true;
if(unit->GetTypeId() == TYPEID_PLAYER)
@@ -643,6 +641,10 @@ void Map::RelocationNotify()
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
}
}
+ for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
+ {
+ (*iter)->m_Notified = false;
+ }
i_unitsToNotify.clear();
}
@@ -656,10 +658,7 @@ void Map::AddUnitToNotify(Unit* u)
if(i_lock)
i_unitsToNotifyBacklog.push_back(u->GetGUID());
else
- {
i_unitsToNotify.push_back(u);
- u->m_Notified = false;
- }
}
void Map::Update(const uint32 &t_diff)
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 6f78d95e079..764cb20c88c 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17828,8 +17828,6 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObjec
#endif
}
}
- else
- SetToNotify();
}
/*template<>