Changeset 58

Show
Ignore:
Timestamp:
11/19/08 13:30:04 (17 years ago)
Author:
yumileroy
Message:

[svn] Add Unit::GetObjectInWorld? function to get object by guid without providing reference.
Small change in SummonGameObject?.
Fix a bug that player can not click summoned najentus spine (must let target summon gameobject).

Original author: megamage
Date: 2008-10-18 19:59:34-05:00

Location:
trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp

    r57 r58  
    217217            m_creature->SetInFront(m_creature->getVictim()); 
    218218            SpineTargetGUID = target->GetGUID(); 
    219             m_creature->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); 
     219            //must let target summon, otherwise you cannot click the spine 
     220            target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); 
    220221 
    221222            switch(rand()%2) 
  • trunk/src/game/Object.cpp

    r56 r58  
    14531453        return NULL; 
    14541454    go->SetRespawnTime(respawnTime); 
    1455     go->SetSpawnedByDefault(false); // do not save respawn time 
    1456     go->SetOwnerGUID(GetGUID()); 
     1455    if(GetTypeId()==TYPEID_PLAYER || GetTypeId()==TYPEID_UNIT) //not sure how to handle this 
     1456        ((Unit*)this)->AddGameObject(go); 
     1457    else 
     1458        go->SetSpawnedByDefault(false); 
    14571459    map->Add(go); 
    14581460 
  • trunk/src/game/Unit.h

    r44 r58  
    12191219        void removeFollower(FollowerReference* /*pRef*/ ) { /* nothing to do yet */ } 
    12201220        static Unit* GetUnit(WorldObject& object, uint64 guid); 
     1221        template<class T> static T* GetObjectInWorld(uint64 guid, T* /*fake*/) 
     1222        { 
     1223            return ObjectAccessor::GetObjectInWorld(uint64 guid, T* /*fake*/) 
     1224        } 
    12211225 
    12221226        MotionMaster* GetMotionMaster() { return &i_motionMaster; }