Core/TempSummons: avoid use MoveInLineOfSight before InitSummon
This commit is contained in:
1 parent
45c911ba94
commit
6a339ed5c9
5 files changed
+15
-2
No files matched your search
@@ -227,6 +227,11 @@ void TempSummon::InitSummon()
|
||||
}
|
||||
}
|
||||
|
||||
void TempSummon::UpdateObjectVisibilityOnCreate()
|
||||
{
|
||||
WorldObject::UpdateObjectVisibility(true);
|
||||
}
|
||||
|
||||
void TempSummon::SetTempSummonType(TempSummonType type)
|
||||
{
|
||||
m_type = type;
|
||||
|
||||
@@ -45,6 +45,7 @@ class TempSummon : public Creature
|
||||
void Update(uint32 time) override;
|
||||
virtual void InitStats(uint32 lifetime);
|
||||
virtual void InitSummon();
|
||||
void UpdateObjectVisibilityOnCreate() override;
|
||||
virtual void UnSummon(uint32 msTime = 0);
|
||||
void RemoveFromWorld() override;
|
||||
void SetTempSummonType(TempSummonType type);
|
||||
|
||||
@@ -1878,7 +1878,9 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
AddToMap(summon->ToCreature());
|
||||
summon->InitSummon();
|
||||
|
||||
//ObjectAccessor::UpdateObjectVisibility(summon);
|
||||
// call MoveInLineOfSight for nearby creatures
|
||||
Trinity::AIRelocationNotifier notifier(*summon);
|
||||
summon->VisitNearbyObject(GetVisibilityRange(), notifier);
|
||||
|
||||
return summon;
|
||||
}
|
||||
|
||||
@@ -555,6 +555,11 @@ class WorldObject : public Object, public WorldLocation
|
||||
|
||||
void DestroyForNearbyPlayers();
|
||||
virtual void UpdateObjectVisibility(bool forced = true);
|
||||
virtual void UpdateObjectVisibilityOnCreate()
|
||||
{
|
||||
UpdateObjectVisibility(true);
|
||||
}
|
||||
|
||||
void BuildUpdate(UpdateDataMapType&) override;
|
||||
|
||||
void AddToObjectUpdate() override;
|
||||
|
||||
@@ -594,7 +594,7 @@ bool Map::AddToMap(T* obj)
|
||||
|
||||
//something, such as vehicle, needs to be update immediately
|
||||
//also, trigger needs to cast spell, if not update, cannot see visual
|
||||
obj->UpdateObjectVisibility(true);
|
||||
obj->UpdateObjectVisibilityOnCreate();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user