diff options
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); } } } |