Core/Objects: Initialize position data and zone/instance script for all worldobject types (except player)

This commit is contained in:
Shauren
2022-04-23 23:03:22 +02:00
parent 372c84e998
commit fddd6cdf3f
6 changed files with 18 additions and 0 deletions

View File

@@ -166,6 +166,9 @@ bool AreaTrigger::Create(uint32 areaTriggerCreatePropertiesId, Unit* caster, Uni
m_movementInfo.transport.guid = target->GetGUID();
}
UpdatePositionData();
SetZoneScript();
UpdateShape();
uint32 timeToTarget = GetCreateProperties()->TimeToTarget != 0 ? GetCreateProperties()->TimeToTarget : *m_areaTriggerData->Duration;

View File

@@ -170,6 +170,9 @@ bool Conversation::Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry,
Object::_Create(ObjectGuid::Create<HighGuid::Conversation>(GetMapId(), conversationEntry, lowGuid));
PhasingHandler::InheritPhaseShift(this, creator);
UpdatePositionData();
SetZoneScript();
SetEntry(conversationEntry);
SetObjectScale(1.0f);

View File

@@ -89,6 +89,9 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
PhasingHandler::InheritPhaseShift(this, owner);
UpdatePositionData();
SetZoneScript();
return true;
}

View File

@@ -94,6 +94,9 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
WorldObject::_Create(ObjectGuid::Create<HighGuid::DynamicObject>(GetMapId(), spell->Id, guidlow));
PhasingHandler::InheritPhaseShift(this, caster);
UpdatePositionData();
SetZoneScript();
SetEntry(spell->Id);
SetObjectScale(1.0f);
auto dynamicObjectData = m_values.ModifyValue(&DynamicObject::m_dynamicObjectData);

View File

@@ -119,6 +119,9 @@ bool SceneObject::Create(ObjectGuid::LowType lowGuid, SceneType type, uint32 sce
Object::_Create(ObjectGuid::Create<HighGuid::SceneObject>(GetMapId(), sceneId, lowGuid));
PhasingHandler::InheritPhaseShift(this, creator);
UpdatePositionData();
SetZoneScript();
SetEntry(scriptPackageId);
SetObjectScale(1.0f);

View File

@@ -4868,6 +4868,9 @@ Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia /*=
PhasingHandler::InheritPhaseShift(bones, corpse);
bones->UpdatePositionData();
bones->SetZoneScript();
AddCorpse(bones);
// add bones in grid store if grid loaded where corpse placed