aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-27 11:31:14 -0600
committermegamage <none@none>2008-12-27 11:31:14 -0600
commit8a337e26c5c41bc126f6fd0b3bfbb783fc6b8aa4 (patch)
tree3d50697c51d344a193e1510aae56ce217bc83acb /src/game
parentbf6e13c8bde0ef08691b4831a0732caf06f3c0c1 (diff)
parentd5e9d0b2c4389998cdbed7cf8fc6fb81c2a22829 (diff)
*HG 681.
--HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Map.cpp10
-rw-r--r--src/game/Map.h1
-rw-r--r--src/game/SpellAuras.cpp6
-rw-r--r--src/game/WaypointMovementGenerator.cpp36
4 files changed, 29 insertions, 24 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 8116510df9b..c1673b1082d 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -653,7 +653,7 @@ bool Map::loaded(const GridPair &p) const
}
}*/
-void Map::Update(const uint32 &t_diff)
+void Map::RelocationNotify()
{
//creatures may be added to the list during update
i_lock = true;
@@ -666,6 +666,7 @@ void Map::Update(const uint32 &t_diff)
continue;
CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
Cell cell(val);
+ cell.SetNoCreate();
//if(unit->GetTypeId() == TYPEID_PLAYER)
// PlayerRelocationNotify((Player*)unit, cell, val);
//else
@@ -693,7 +694,10 @@ void Map::Update(const uint32 &t_diff)
}
i_unitsToNotify.clear();
i_lock = false;
+}
+void Map::Update(const uint32 &t_diff)
+{
resetMarkedCells();
//TODO: is there a better way to update activeobjects?
@@ -743,7 +747,7 @@ void Map::Update(const uint32 &t_diff)
CellPair pair(x,y);
Cell cell(pair);
cell.data.Part.reserved = CENTER_DISTRICT;
- cell.SetNoCreate();
+ //cell.SetNoCreate();
CellLock<NullGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, grid_object_update, *this);
cell_lock->Visit(cell_lock, world_object_update, *this);
@@ -754,6 +758,8 @@ void Map::Update(const uint32 &t_diff)
// UpdateActiveCells((*iter)->GetPositionX(), (*iter)->GetPositionY(), t_diff);
}
+ RelocationNotify();
+
// Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load !
// This isn't really bother us, since as soon as we have instanced BG-s, the whole map unloads as the BG gets ended
if (IsBattleGroundOrArena())
diff --git a/src/game/Map.h b/src/game/Map.h
index 43f9326c108..074c859c408 100644
--- a/src/game/Map.h
+++ b/src/game/Map.h
@@ -259,6 +259,7 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
void AddActiveObject(WorldObject* obj) { i_activeObjects.insert(obj); }
void RemoveActiveObject(WorldObject* obj) { i_activeObjects.erase(obj); }
void AddUnitToNotify(Unit* unit);
+ void RelocationNotify();
void SendToPlayers(WorldPacket const* data) const;
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 26725388f7e..90e67dfe344 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1190,10 +1190,6 @@ void Aura::TriggerSpell()
uint64 originalCasterGUID = GetCasterGUID();
SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
- SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(triggeredSpellInfo->rangeIndex);
- if(!GetSpellMaxRange(srange))
- target = caster; //for druid dispel poison
-
SpellEntry const *auraSpellInfo = GetSpellProto();
uint32 auraId = auraSpellInfo->Id;
@@ -1881,6 +1877,8 @@ void Aura::TriggerSpell()
}
}
}
+ if(!GetSpellMaxRange(sSpellRangeStore.LookupEntry(triggeredSpellInfo->rangeIndex)))
+ target = m_target; //for druid dispel poison
m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, originalCasterGUID);
}
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 57dacea61e3..8786d25549e 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -33,24 +33,6 @@ WaypointMovementGenerator<T>::Initialize(T &u){}
template<>
void
-WaypointMovementGenerator<Creature>::Initialize(Creature &u)
-{
- u.StopMoving();
- if(!path_id)
- path_id = u.GetWaypointPath();
- waypoints = WaypointMgr.GetPath(path_id);
- if(waypoints && waypoints->size())
- {
- Traveller<Creature> traveller(u);
- node = *(waypoints->at(i_currentNode));
- InitTraveller(u,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
- i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
- }
-}
-
-template<>
-void
WaypointMovementGenerator<Creature>::Finalize(Creature &u){}
template<>
@@ -109,6 +91,24 @@ void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const Wa
}
template<>
+void
+WaypointMovementGenerator<Creature>::Initialize(Creature &u)
+{
+ u.StopMoving();
+ if(!path_id)
+ path_id = u.GetWaypointPath();
+ waypoints = WaypointMgr.GetPath(path_id);
+ if(waypoints && waypoints->size())
+ {
+ Traveller<Creature> traveller(u);
+ node = *(waypoints->at(i_currentNode));
+ InitTraveller(u,node);
+ i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
+ }
+}
+
+template<>
void WaypointMovementGenerator<Player>::InitTraveller(Player &unit, const WaypointData &node){}
template<class T>