Core/GameObject: spawn linked traps at gameobject creation instead of…
… using DB spawns.
This commit is contained in:
1 parent
695b3df525
commit
1659ea03cf
3 files changed
+26
-41
No files matched your search
@@ -324,6 +324,18 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
if (map->Is25ManRaid())
|
||||
loot.maxDuplicates = 3;
|
||||
|
||||
if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject();
|
||||
if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map, phaseMask, pos, rotation, 255, GO_STATE_READY))
|
||||
{
|
||||
SetLinkedTrap(linkedGO);
|
||||
map->AddToMap(linkedGO);
|
||||
}
|
||||
else
|
||||
delete linkedGO;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user