aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp3
-rw-r--r--src/game/Object.cpp6
-rw-r--r--src/game/Unit.h4
3 files changed, 10 insertions, 3 deletions
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
index 6e2f20394d5..6bf64ba0036 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
@@ -216,7 +216,8 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true);
m_creature->SetInFront(m_creature->getVictim());
SpineTargetGUID = target->GetGUID();
- m_creature->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
+ //must let target summon, otherwise you cannot click the spine
+ target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30);
switch(rand()%2)
{
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 881e4d2515a..a64ef9fa744 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1452,8 +1452,10 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry,map,x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,1))
return NULL;
go->SetRespawnTime(respawnTime);
- go->SetSpawnedByDefault(false); // do not save respawn time
- go->SetOwnerGUID(GetGUID());
+ if(GetTypeId()==TYPEID_PLAYER || GetTypeId()==TYPEID_UNIT) //not sure how to handle this
+ ((Unit*)this)->AddGameObject(go);
+ else
+ go->SetSpawnedByDefault(false);
map->Add(go);
return go;
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 4410dd45b72..fa6e2cdf111 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1218,6 +1218,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
void removeFollower(FollowerReference* /*pRef*/ ) { /* nothing to do yet */ }
static Unit* GetUnit(WorldObject& object, uint64 guid);
+ template<class T> static T* GetObjectInWorld(uint64 guid, T* /*fake*/)
+ {
+ return ObjectAccessor::GetObjectInWorld(uint64 guid, T* /*fake*/)
+ }
MotionMaster* GetMotionMaster() { return &i_motionMaster; }