diff options
author | megamage <none@none> | 2009-04-19 14:35:55 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-19 14:35:55 -0500 |
commit | 995410c475efa13e4b021b1df9f27d8e66fedd23 (patch) | |
tree | 439b1f7282136f7c002fa6eddb4ab96234302290 /src/game/ObjectAccessor.cpp | |
parent | 862cd5fcd7a6af09ed4d282c3737d06cebb166b7 (diff) |
*Fix a crash caused by farsight spells.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r-- | src/game/ObjectAccessor.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 7daf7e5395e..4df45812f7f 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -514,11 +514,13 @@ ObjectAccessor::WorldObjectChangeAccumulator::Visit(DynamicObjectMapType &m) { for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { - if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID())) + uint64 guid = iter->getSource()->GetCasterGUID(); + if(IS_PLAYER_GUID(guid)) { - Player* caster = (Player*)iter->getSource()->GetCaster(); - if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID()) - BuildPacket(caster); + //Caster may be NULL if DynObj is in removelist + if(Player *caster = FindPlayer(guid)) + if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID()) + BuildPacket(caster); } } } |