aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-12 16:51:46 -0500
committermegamage <none@none>2009-04-12 16:51:46 -0500
commit785dc693186357250b808825b6026abaec1c3e8f (patch)
tree96d65048d7256e0fa0617e706be2017801bd4be4 /src/game
parent3f97137ce9bd6113613c9ee81049fa9649dddc84 (diff)
parent5032bd159cc0fff5e10d38161ecb5e7469c3d75f (diff)
*Merge.
*One rev skipped: Fixed exploit with several spells being casted on pet with no de-buff applied. Author: Elron. --HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GridStates.cpp3
-rw-r--r--src/game/Map.cpp4
-rw-r--r--src/game/MotionMaster.cpp4
-rw-r--r--src/game/ObjectMgr.cpp1
-rw-r--r--src/game/Player.cpp2
5 files changed, 9 insertions, 5 deletions
diff --git a/src/game/GridStates.cpp b/src/game/GridStates.cpp
index fa1c0a2b534..36092fbdc29 100644
--- a/src/game/GridStates.cpp
+++ b/src/game/GridStates.cpp
@@ -40,6 +40,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c
ObjectGridStoper stoper(grid);
stoper.StopN();
grid.SetGridState(GRID_STATE_IDLE);
+ sLog.outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId());
}
else
{
@@ -53,7 +54,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui
{
m.ResetGridExpiry(grid);
grid.SetGridState(GRID_STATE_REMOVAL);
- sLog.outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId());
+ sLog.outDebug("Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId());
}
void
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index ac81b9c2a6d..fd9fd6ce5c2 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -386,6 +386,8 @@ Map::EnsureGridCreated(const GridPair &p)
Guard guard(*this);
if(!getNGrid(p.x_coord, p.y_coord))
{
+ sLog.outDebug("Loading grid[%u,%u] for map %u", p.x_coord, p.y_coord, i_id);
+
setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getConfig(CONFIG_GRID_UNLOAD)),
p.x_coord, p.y_coord);
@@ -1113,7 +1115,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll)
if(!unloadAll && ActiveObjectsNearGrid(x, y) )
return false;
- DEBUG_LOG("Unloading grid[%u,%u] for map %u", x,y, i_id);
+ sLog.outDebug("Unloading grid[%u,%u] for map %u", x,y, i_id);
ObjectGridUnloader unloader(*grid);
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index ee6cc05a5d2..51e684c5a6c 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -242,7 +242,7 @@ void
MotionMaster::MoveChase(Unit* target, float dist, float angle)
{
// ignore movement request if target not exist
- if(!target)
+ if(!target || target == i_owner)
return;
i_owner->clearUnitState(UNIT_STAT_FOLLOW);
@@ -268,7 +268,7 @@ void
MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
{
// ignore movement request if target not exist
- if(!target)
+ if(!target || target == i_owner)
return;
i_owner->addUnitState(UNIT_STAT_FOLLOW);
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index efb5d0974ca..b797757a9f3 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -161,6 +161,7 @@ ObjectMgr::~ObjectMgr()
for (GuildMap::iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr)
delete itr->second;
+ mGuildMap.clear();
for (CachePlayerInfoMap::iterator itr = m_mPlayerInfoMap.begin(); itr != m_mPlayerInfoMap.end(); ++itr)
delete itr->second;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index ae14d5ebc30..1779ea84d7c 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17987,7 +17987,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false;
}
- if(u->GetVisibility() == VISIBILITY_OFF)
+ if(u->GetVisibility() == VISIBILITY_OFF || u->m_invisibilityMask )
{
// GMs see any players, not higher GMs and all units
if(isGameMaster())