Core/TempSummons: avoid use MoveInLineOfSight before InitSummon (#20999)
This commit is contained in:
parent
ebf7f7583b
commit
2110f7cc84
5 changed files with 11 additions and 2 deletions
|
|
@ -274,6 +274,11 @@ void TempSummon::InitSummon()
|
|||
}
|
||||
}
|
||||
|
||||
void TempSummon::UpdateObjectVisibilityOnCreate()
|
||||
{
|
||||
WorldObject::UpdateObjectVisibility(true);
|
||||
}
|
||||
|
||||
void TempSummon::SetTempSummonType(TempSummonType type)
|
||||
{
|
||||
m_type = type;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public:
|
|||
virtual void InitStats(uint32 lifetime);
|
||||
virtual void InitSummon();
|
||||
virtual void UnSummon(uint32 msTime = 0);
|
||||
void UpdateObjectVisibilityOnCreate() override;
|
||||
void RemoveFromWorld() override;
|
||||
void SetTempSummonType(TempSummonType type);
|
||||
void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) override {}
|
||||
|
|
|
|||
|
|
@ -2274,7 +2274,9 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
|||
|
||||
summon->InitSummon();
|
||||
|
||||
//ObjectAccessor::UpdateObjectVisibility(summon);
|
||||
// call MoveInLineOfSight for nearby creatures
|
||||
Acore::AIRelocationNotifier notifier(*summon);
|
||||
Cell::VisitAllObjects(summon, notifier, GetVisibilityRange());
|
||||
|
||||
return summon;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -558,6 +558,7 @@ public:
|
|||
|
||||
void DestroyForNearbyPlayers();
|
||||
virtual void UpdateObjectVisibility(bool forced = true, bool fromUpdate = false);
|
||||
virtual void UpdateObjectVisibilityOnCreate() { UpdateObjectVisibility(true); }
|
||||
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set) override;
|
||||
void GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry);
|
||||
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ bool Map::AddToMap(T* obj, bool checkTransport)
|
|||
if (obj->IsInWorld())
|
||||
{
|
||||
ASSERT(obj->IsInGrid());
|
||||
obj->UpdateObjectVisibility(true);
|
||||
obj->UpdateObjectVisibilityOnCreate();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue