From 448ccc2b9e0070bb7b293e63a43bdc94bdd5d51d Mon Sep 17 00:00:00 2001 From: SnapperRy Date: Tue, 1 Nov 2016 22:24:03 +0100 Subject: Core/GameObject: spawn linked traps at gameobject creation instead of using DB spawns. (#18172) Closes #11328. (cherry picked from commit a38c094a11dc61c8ee1153e0aee6de9a406d6a61) --- src/server/game/Entities/GameObject/GameObject.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/server/game/Entities') diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 74ca9b1225d..6c736f66bf7 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -197,7 +197,7 @@ void GameObject::RemoveFromWorld() } } -bool GameObject::Create(uint32 name_id, Map* map, uint32 /*phaseMask*/, Position const& pos, QuaternionData const& rotation, uint32 animprogress, GOState go_state, uint32 artKit /*= 0*/) +bool GameObject::Create(uint32 name_id, Map* map, uint32 phaseMask, Position const& pos, QuaternionData const& rotation, uint32 animprogress, GOState go_state, uint32 artKit /*= 0*/) { ASSERT(map); SetMap(map); @@ -378,6 +378,18 @@ bool GameObject::Create(uint32 name_id, Map* map, uint32 /*phaseMask*/, Position if (map->Is25ManRaid()) loot.maxDuplicates = 3; + if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry()) + { + GameObject* linkedGO = new GameObject(); + if (linkedGO->Create(linkedEntry, map, phaseMask, pos, rotation, 255, GO_STATE_READY)) + { + SetLinkedTrap(linkedGO); + map->AddToMap(linkedGO); + } + else + delete linkedGO; + } + return true; } -- cgit v1.2.3