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

[svn] * Little fix in RandomMovementGenerator?
* Updated to 6731 and 680

Original author: Neo2003
Date: 2008-10-06 04:48:59-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/GameObject.cpp

    r2 r18  
    5555    m_cooldownTime = 0; 
    5656    m_goInfo = NULL; 
     57 
     58    m_DBTableGuid = 0; 
    5759} 
    5860 
     
    109111    Object::_Create(guidlow, goinfo->id, HIGHGUID_GAMEOBJECT); 
    110112 
    111     m_DBTableGuid = guidlow; 
    112113    m_goInfo = goinfo; 
    113114 
     
    479480void GameObject::SaveToDB() 
    480481{ 
    481     // this should only be used when the creature has already been loaded 
     482    // this should only be used when the gameobject has already been loaded 
    482483    // perferably after adding to map, because mapid may not be valid otherwise 
    483484    GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid); 
     
    497498    if (!goI) 
    498499        return; 
    499  
     500     
     501    if (!m_DBTableGuid) 
     502        m_DBTableGuid = GetGUIDLow(); 
    500503    // update in loaded data (changing data only in this place) 
    501504    GameObjectData& data = objmgr.NewGOData(m_DBTableGuid); 
     
    567570    uint32 go_state = data->go_state; 
    568571 
    569     uint32 stored_guid = guid; 
     572    m_DBTableGuid = guid; 
    570573    if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); 
    571574 
    572575    if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) ) 
    573576        return false; 
    574  
    575     m_DBTableGuid = stored_guid; 
    576577 
    577578    switch(GetGOInfo()->type) 
     
    590591                m_spawnedByDefault = true; 
    591592                m_respawnDelayTime = data->spawntimesecs; 
    592                 m_respawnTime = objmgr.GetGORespawnTime(stored_guid, map->GetInstanceId()); 
     593                m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); 
    593594 
    594595                                                            // ready to respawn 
     
    11591160            Player* player = (Player*)user; 
    11601161 
    1161             if( player->InBattleGround() &&                 // in battleground 
    1162                 !player->IsMounted() &&                     // not mounted 
    1163                 !player->HasStealthAura() &&                // not stealthed 
    1164                 !player->HasInvisibilityAura() &&           // not invisible 
    1165                 player->isAlive())                          // live player 
    1166             { 
     1162            if( player->isAllowUseBattleGroundObject() ) 
     1163            { 
     1164                // in battleground check 
    11671165                BattleGround *bg = player->GetBattleGround(); 
    11681166                if(!bg) 
     
    11871185            Player* player = (Player*)user; 
    11881186 
    1189             if( player->InBattleGround() &&                 // in battleground 
    1190                 !player->IsMounted() &&                     // not mounted 
    1191                 !player->HasStealthAura() &&                // not stealthed 
    1192                 !player->HasInvisibilityAura() &&           // not invisible 
    1193                 !player->HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) &&  // can't pickup 
    1194                 player->isAlive())                          // live player 
    1195             { 
     1187            if( player->isAllowUseBattleGroundObject() )      
     1188            { 
     1189                // in battleground check 
    11961190                BattleGround *bg = player->GetBattleGround(); 
    11971191                if(!bg)