aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids/Notifiers
diff options
context:
space:
mode:
authorlinencloth <none@none>2010-11-13 17:18:09 +0100
committerlinencloth <none@none>2010-11-13 17:18:09 +0100
commitbf888285aab32ae2571002f23dd217396b2f12d8 (patch)
treee13695f4909b7df4f218057126919321b4374f58 /src/server/game/Grids/Notifiers
parent995408f0a9e6512af53e7719799d332d487f84eb (diff)
Core:
- Redesigned stealth and invisibility handling - Implemented the handling of multiple stealth types - Implemented fake inebriation - The message deliverer no longer sends packets from a non-visible source - The server won't send that much garbage which just takes bandwith - It won't be possible to use cheats to detect invisible objects - Removed a lot of checks for the Z-coord - Fixes visibility problems happening while flying - Limited the grid activation range of creatures to use less resources - Implemented Shroud of Death - Implemented increased visibility range for active objects - Removed visibility check at spellhit (only sanctuary effects should prevent it) (And a lot of other changes...) Closes issue 4208 Closes issue 3049 Closes issue 2097 Closes issue 2198 Closes issue 2384 Closes issue 2197 Closes issue 2319 --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Grids/Notifiers')
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.cpp8
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.h12
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiersImpl.h4
3 files changed, 16 insertions, 8 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index 663743e2c2e..2bb846c9533 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -117,7 +117,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
return;
if (c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS))
- if (c->_IsWithinDist(u, c->m_SightDistance, true) && c->IsAIEnabled)
+ if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true))
c->AI()->MoveInLineOfSight_Safe(u);
}
@@ -249,7 +249,7 @@ MessageDistDeliverer::Visit(PlayerMapType &m)
if (!target->InSamePhase(i_phaseMask))
continue;
- if (target->GetExactDistSq(i_source) > i_distSq)
+ if (target->GetExactDist2dSq(i_source) > i_distSq)
continue;
// Send packet to all who are sharing the player's vision
@@ -274,7 +274,7 @@ MessageDistDeliverer::Visit(CreatureMapType &m)
if (!iter->getSource()->InSamePhase(i_phaseMask))
continue;
- if (iter->getSource()->GetExactDistSq(i_source) > i_distSq)
+ if (iter->getSource()->GetExactDist2dSq(i_source) > i_distSq)
continue;
// Send packet to all who are sharing the creature's vision
@@ -296,7 +296,7 @@ MessageDistDeliverer::Visit(DynamicObjectMapType &m)
if (!iter->getSource()->InSamePhase(i_phaseMask))
continue;
- if (iter->getSource()->GetExactDistSq(i_source) > i_distSq)
+ if (iter->getSource()->GetExactDist2dSq(i_source) > i_distSq)
continue;
if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 10f9e90b63e..f0a6337ec52 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -143,6 +143,9 @@ namespace Trinity
if (plr == i_source || (team && plr->GetTeam() != team) || skipped_receiver == plr)
return;
+ if (!plr->HaveAtClient(i_source))
+ return;
+
plr->GetSession()->SendPacket(i_message);
}
};
@@ -809,7 +812,7 @@ namespace Trinity
return u->isAlive()
&& i_obj->IsWithinDistInMap(u, i_range)
&& !i_funit->IsFriendlyTo(u)
- && u->isVisibleForOrDetect(i_funit, false);
+ && u->canSeeOrDetect(i_funit);
}
private:
WorldObject const* i_obj;
@@ -871,7 +874,7 @@ namespace Trinity
bool operator()(Unit* u)
{
if (u->isTargetableForAttack() && i_obj->IsWithinDistInMap(u, i_range) &&
- !i_funit->IsFriendlyTo(u) && u->isVisibleForOrDetect(i_funit,false))
+ !i_funit->IsFriendlyTo(u) && u->canSeeOrDetect(i_funit))
{
i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
return true;
@@ -957,10 +960,12 @@ namespace Trinity
bool operator()(Unit* u) { return !u->isAlive(); }
};
+ /*
struct AnyStealthedCheck
{
bool operator()(Unit* u) { return u->GetVisibility() == VISIBILITY_GROUP_STEALTH; }
};
+ */
// Creature checks
@@ -1002,6 +1007,9 @@ namespace Trinity
if (!me->IsWithinDistInMap(u, m_range))
return false;
+ if (!me->canSeeOrDetect(u))
+ return false;
+
if (m_force)
{
if (!me->canAttack(u))
diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
index ad84384b0f9..9f2ff9be790 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
@@ -42,8 +42,8 @@ Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
inline void
Trinity::ObjectUpdater::Visit(CreatureMapType &m)
{
- for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
- if (iter->getSource()->IsInWorld() && !iter->getSource()->isSpiritService())
+ for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
+ if (iter->getSource()->IsInWorld())
iter->getSource()->Update(i_timeDiff);
}